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 <gouthamve@gmail.com>

* Add tests for relabeling working

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>

* Use Prometheus main branch

prometheus/prometheus#10473 has been merged

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>

* Add back the tests

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>

* Fix flaky test

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>

* Add Changelog entry

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>

* Add relabel test with the e2e framework

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>

* Update receiver/prometheusreceiver/metrics_receiver_labels_test.go

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Move changelog entry to unreleased

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>

* Make lint pass

Needed to run make gotidy; make golint

strings.Title is deprecated

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Juraci Paixão Kröhling <juraci@kroehling.de>
  • 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.