Skip to content
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

Use storage package for Prometheus remote read #9967

Merged
merged 12 commits into from
Jun 13, 2018

Conversation

e-dard
Copy link
Contributor

@e-dard e-dard commented Jun 12, 2018

This PR converts the Prometheus remote read endpoint to use the storage package, rather than the InfluxQL query engine.

This results in a number of improvements in performance and efficiency.

The PR also fixes a bug in the storage package, where regex expressions were not being properly handled for storage requests.

Finally it adds some higher-level end-to-end tests in the tests package.

pauldix and others added 8 commits June 12, 2018 15:54
@ghost ghost assigned e-dard Jun 12, 2018
@ghost ghost added the review label Jun 12, 2018
@e-dard e-dard force-pushed the pd-prometheus-to-new-storage branch from bccec99 to 1eca009 Compare June 12, 2018 23:20
@influxdata influxdata deleted a comment from hercules-influx Jun 12, 2018
@influxdata influxdata deleted a comment from hercules-influx Jun 12, 2018
Copy link
Contributor

@stuartcarnie stuartcarnie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great Edd 🍻 Nice work making it more testable too!

Only one change required to fix a cursor leak and a couple of blank space nits.

}
cur.Close()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cur.Close() should be moved outside the switch to ensure all cursor types are closed or it will result in TSM file handle leaks.

"github.com/google/go-cmp/cmp"

"github.com/influxdata/influxdb/logger"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blank spaces

"strconv"
"strings"
"sync"
"testing"
"time"

"github.com/google/go-cmp/cmp"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blank space

@@ -108,6 +110,11 @@ type Handler struct {
WritePoints(database, retentionPolicy string, consistencyLevel models.ConsistencyLevel, user meta.User, points []models.Point) error
}

Store interface {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a strong preference for inline interface definitions vs promoting it to a package-level type? i.e.

type Store interface {
    Read(ctx context.Context, req *storage.ReadRequest) (storage.Results, error)
    WithLogger(log *zap.Logger)
}

My case is that some tools appear to have a harder time identifying inlined interfaces and subsequently other types which implement this interface.

@e-dard e-dard force-pushed the pd-prometheus-to-new-storage branch from 8b93cfe to 3cb9e13 Compare June 13, 2018 16:42
@e-dard
Copy link
Contributor Author

e-dard commented Jun 13, 2018

@stuartcarnie feedback addressed.

Copy link
Contributor

@stuartcarnie stuartcarnie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM mate 🎉

@e-dard e-dard merged commit 83572fb into master Jun 13, 2018
@ghost ghost removed the review label Jun 13, 2018
@e-dard e-dard deleted the pd-prometheus-to-new-storage branch June 13, 2018 17:20
@e-dard e-dard mentioned this pull request Jun 25, 2018
10 tasks
jacobmarble pushed a commit that referenced this pull request Jun 27, 2018
Use storage package for Prometheus remote read
jacobmarble pushed a commit that referenced this pull request Jun 27, 2018
Use storage package for Prometheus remote read
jacobmarble pushed a commit that referenced this pull request Jun 27, 2018
Use storage package for Prometheus remote read
jacobmarble pushed a commit that referenced this pull request Jun 27, 2018
Use storage package for Prometheus remote read
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants