Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
proddata committed Aug 5, 2024
1 parent cbbd41d commit 6f93e3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CHANGES for CrateDB Prometheus Adapter
Unreleased
==========

- Add option to configure primary key conflict behaviour.

2024-01-23 0.5.1
================
Expand Down
6 changes: 3 additions & 3 deletions crate.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/prometheus/common/model"
)

const crateWriteStatement = `INSERT INTO metrics ("labels", "labels_hash", "timestamp", "value", "valueRaw") VALUES ($1, $2, $3, $4, $5)`
const crateWriteStatement = `INSERT INTO metrics ("labels", "labels_hash", "timestamp", "value", "valueRaw") VALUES ($1, $2, $3, $4, $5) ON CONFLICT DO NOTHING`

type crateRow struct {
labels model.Metric
Expand Down Expand Up @@ -113,8 +113,8 @@ func newCrateEndpoint(ep *endpointConfig) *crateEndpoint {

func (c *crateEndpoint) endpoint() endpoint.Endpoint {
/**
* Initialize connection pools lazily here instead of in `newCrateEndpoint()`,
* so that the adapter does not crash on startup if the endpoint is unavailable.
* Initialize connection pools lazily here instead of in `newCrateEndpoint()`,
* so that the adapter does not crash on startup if the endpoint is unavailable.
**/
return func(ctx context.Context, request interface{}) (response interface{}, err error) {

Expand Down

0 comments on commit 6f93e3b

Please sign in to comment.