-
Notifications
You must be signed in to change notification settings - Fork 1.7k
InfluxDB Connector for GoFr #2072
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
InfluxDB Connector for GoFr #2072
Conversation
…operations, [AddInfluxDB()] method for externalized datasource added. [logging] standard app logging implemented for influxdb
…y organisation name.
…zation, Ping, ListBuckets, DeleteBucket, all got implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Create a separate
go.mod
forpkg/gofr.datasource/influxdb
and please make sure no unnecessary imports are added to GoFr'sgo.mod
. - No test files added. Please make sure to try and achieve atleast 80-85% code coverage in the newly added directory
influxdb
. - GoDoc comments are not proper and lacks info about the method.
- Your newly added code has a lot of linter errors in
pkg/gofr/datasource/influxdb
. Please address and resolve them. - The file
interfaces.go
is empty. If you don;t need it you can delete it but i think you need it for testing and other purposes. Please refer to other datasources and you will understand. - Let's add screenshots for InfluxDB logs and queries to see how they look after pretty printed.
go.mod
Outdated
@@ -17,6 +17,7 @@ require ( | |||
github.com/gorilla/mux v1.8.1 | |||
github.com/gorilla/websocket v1.5.3 | |||
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 | |||
github.com/influxdata/influxdb-client-go/v2 v2.14.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akhilsharmaa We can't insert the dependency github.com/influxdata/influxdb-client-go/v2
inside GoFr's go.mod
. The whole reason to create a separate directory inside pkg/gofr/datasource
was that datasources will have their own go.mod
files and GoFr binary file will be clean. Please follow the same for InfluxDB too.
@@ -721,3 +722,52 @@ type ElasticsearchProvider interface { | |||
|
|||
provider | |||
} | |||
|
|||
type InfluxPoint struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don;t define these struct here but only the interface and methods that are being implemented by the client of respective datasource. Please remove this InfluxPoint
declaration from here.
import ( | ||
"context" | ||
"fmt" | ||
"gofr.dev/pkg/gofr/datasource" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The imports are not sorted here
// CreateOrganization implements container.InfluxDBProvider. | ||
func (c *Client) CreateOrganization(ctx context.Context, orgName string) (string, error) { | ||
if orgName == "" { | ||
return "", fmt.Errorf("org Name name must not be empty") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please try and use predefined errors.
return *newOrg.Id, nil | ||
} | ||
|
||
// DeleteOrganization implements container.InfluxDBProvider. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The godoc comment should tell what the method does not what it is implementing.
@Umang01-hash thanks for the review, i am working on it. |
InfluxDB Connector for GoFr
Closes: #1994
Contributor: Akhilesh Kumar Sharma
Track: Core Framework
Overview
This PR introduces native support for InfluxDB, a widely-used time-series database, to GoFr. With this integration, GoFr can now seamlessly store and query high-frequency data such as metrics and sensor data, enhancing its capabilities for time-series workloads.
Problem
Currently, GoFr does not support InfluxDB, which restricts its ability to effectively manage time-series data. This integration addresses that limitation by adding the necessary functionality.
Scope
The following changes and features have been implemented in this PR:
pkg/gofr/datasource/influxdb
.App
to utilize the datasource.Checklist
goimport
andgolangci-lint
.