Skip to content

Commit

Permalink
Use target and metadata from context (#8780)
Browse files Browse the repository at this point in the history
* Use target and metadata from context

This fixes #5757 and #5663

Signed-off-by: Goutham Veeramachaneni <[email protected]>

* Add tests for relabeling working

Signed-off-by: Goutham Veeramachaneni <[email protected]>

* Use Prometheus main branch

prometheus/prometheus#10473 has been merged

Signed-off-by: Goutham Veeramachaneni <[email protected]>

* Add back the tests

Signed-off-by: Goutham Veeramachaneni <[email protected]>

* Fix flaky test

Signed-off-by: Goutham Veeramachaneni <[email protected]>

* Add Changelog entry

Signed-off-by: Goutham Veeramachaneni <[email protected]>

* Add relabel test with the e2e framework

Signed-off-by: Goutham Veeramachaneni <[email protected]>

* Update receiver/prometheusreceiver/metrics_receiver_labels_test.go

Co-authored-by: Anthony Mirabella <[email protected]>

* Move changelog entry to unreleased

Signed-off-by: Juraci Paixão Kröhling <[email protected]>

* Make lint pass

Needed to run make gotidy; make golint

strings.Title is deprecated

Signed-off-by: Goutham Veeramachaneni <[email protected]>

Co-authored-by: Anthony Mirabella <[email protected]>
Co-authored-by: Juraci Paixão Kröhling <[email protected]>
  • Loading branch information
3 people authored Apr 5, 2022
1 parent c12e7f5 commit e0ba61c
Show file tree
Hide file tree
Showing 26 changed files with 1,555 additions and 2,603 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@

### 🚀 New components 🚀

### 🧰 Bug fixes 🧰

- `prometheusreceiver`: Fix issues with relabelling the `job` and `instance` labels. (#8780)

## v0.48.0

### 💡 Enhancements 💡
Expand Down
6 changes: 4 additions & 2 deletions cmd/configschema/docsgen/docsgen/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,19 @@ package docsgen // import "github.com/open-telemetry/opentelemetry-collector-con
import (
"bytes"
"fmt"
"strings"
"text/template"

"golang.org/x/text/cases"
"golang.org/x/text/language"

"github.com/open-telemetry/opentelemetry-collector-contrib/cmd/configschema"
)

func renderHeader(typ, group, doc string) []byte {
return []byte(fmt.Sprintf(
"# %q %s Reference\n\n%s\n\n",
typ,
strings.Title(group),
cases.Title(language.English).String(group),
doc,
))
}
Expand Down
27 changes: 14 additions & 13 deletions cmd/configschema/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ require (
go.opentelemetry.io/collector/model v0.48.0
go.uber.org/multierr v1.8.0
golang.org/x/mod v0.5.1
golang.org/x/text v0.3.7
)

require (
Expand All @@ -26,9 +27,9 @@ require (
code.cloudfoundry.org/go-loggregator v7.4.0+incompatible // indirect
code.cloudfoundry.org/rfc5424 v0.0.0-20201103192249-000122071b78 // indirect
contrib.go.opencensus.io/exporter/stackdriver v0.13.10 // indirect
github.com/Azure/azure-sdk-for-go v61.1.0+incompatible // indirect
github.com/Azure/azure-sdk-for-go v62.0.0+incompatible // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.23 // indirect
github.com/Azure/go-autorest/autorest v0.11.24 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.18 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
Expand Down Expand Up @@ -83,7 +84,7 @@ require (
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4 // indirect
github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490 // indirect
github.com/containerd/console v1.0.3 // indirect
github.com/containerd/containerd v1.5.9 // indirect
github.com/containerd/containerd v1.6.1 // indirect
github.com/containerd/ttrpc v1.1.0 // indirect
github.com/coralogix/opentelemetry-cx-protobuf-api/coralogixpb v0.0.0-20211201100428-d2a5d0ecf53e // indirect
github.com/coreos/go-oidc v2.2.1+incompatible // indirect
Expand All @@ -92,7 +93,7 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dennwc/varint v1.0.0 // indirect
github.com/dgraph-io/ristretto v0.1.0 // indirect
github.com/digitalocean/godo v1.73.0 // indirect
github.com/digitalocean/godo v1.75.0 // indirect
github.com/docker/distribution v2.8.0-beta.1+incompatible // indirect
github.com/docker/docker v20.10.14+incompatible // indirect
github.com/docker/go-connections v0.4.1-0.20210727194412-58542c764a11 // indirect
Expand All @@ -105,7 +106,7 @@ require (
github.com/elastic/go-elasticsearch/v7 v7.17.1 // indirect
github.com/elastic/go-structform v0.0.9 // indirect
github.com/envoyproxy/go-control-plane v0.10.1 // indirect
github.com/envoyproxy/protoc-gen-validate v0.6.2 // indirect
github.com/envoyproxy/protoc-gen-validate v0.6.6 // indirect
github.com/euank/go-kmsg-parser v2.0.0+incompatible // indirect
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect
github.com/facebookgo/limitgroup v0.0.0-20150612190941-6abd8d71ec01 // indirect
Expand All @@ -130,7 +131,7 @@ require (
github.com/gofrs/uuid v4.0.0+incompatible // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.0.0 // indirect
github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
Expand All @@ -143,6 +144,7 @@ require (
github.com/googleapis/gnostic v0.5.6 // indirect
github.com/gophercloud/gophercloud v0.24.0 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/grafana/regexp v0.0.0-20220304095617-2e8d9baf4ac2 // indirect
github.com/grobie/gomemcache v0.0.0-20180201122607-1f779c573665 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/hashicorp/consul/api v1.12.0 // indirect
Expand Down Expand Up @@ -190,7 +192,7 @@ require (
github.com/kolo/xmlrpc v0.0.0-20201022064351-38db28db192b // indirect
github.com/leoluk/perflib_exporter v0.1.0 // indirect
github.com/lib/pq v1.10.4 // indirect
github.com/linode/linodego v1.2.1 // indirect
github.com/linode/linodego v1.3.0 // indirect
github.com/logzio/jaeger-logzio v1.0.4 // indirect
github.com/logzio/logzio-go v1.0.3 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
Expand All @@ -201,7 +203,7 @@ require (
github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/microsoft/ApplicationInsights-Go v0.4.4 // indirect
github.com/miekg/dns v1.1.45 // indirect
github.com/miekg/dns v1.1.46 // indirect
github.com/mindprince/gonvml v0.0.0-20190828220739-9ebdce4bb989 // indirect
github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
Expand Down Expand Up @@ -385,11 +387,11 @@ require (
github.com/prometheus/common v0.33.0 // indirect
github.com/prometheus/common/sigv4 v0.1.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/prometheus/prometheus v1.8.2-0.20220117154355-4855a0c067e2 // indirect
github.com/prometheus/prometheus v1.8.2-0.20220324155304-4d8bbfd4164c // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rs/cors v1.8.2 // indirect
github.com/santhosh-tekuri/jsonschema v1.2.4 // indirect
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210223165440-c65ae3540d44 // indirect
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9 // indirect
github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921 // indirect
github.com/shirou/gopsutil v3.21.10+incompatible // indirect
github.com/shirou/gopsutil/v3 v3.22.3 // indirect
Expand Down Expand Up @@ -422,8 +424,8 @@ require (
github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect
github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
github.com/vincent-petithory/dataurl v1.0.0 // indirect
github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852 // indirect
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae // indirect
github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5 // indirect
github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f // indirect
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/wavefronthq/wavefront-sdk-go v0.9.10 // indirect
Expand Down Expand Up @@ -451,7 +453,6 @@ require (
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 // indirect
golang.org/x/tools v0.1.9 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
Expand Down
Loading

0 comments on commit e0ba61c

Please sign in to comment.