Skip to content

Commit

Permalink
Merge branch 'main' into fix-router-random-statements
Browse files Browse the repository at this point in the history
  • Loading branch information
djaglowski authored Sep 5, 2024
2 parents 471a0e4 + fa4cac5 commit c583bab
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 15 deletions.
4 changes: 2 additions & 2 deletions cmd/otelcontribcol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ require (
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/leodido/go-syslog/v4 v4.1.0 // indirect
github.com/leodido/ragel-machinery v0.0.0-20190525184631-5f46317e436b // indirect
github.com/lestrrat-go/strftime v1.0.6 // indirect
github.com/lestrrat-go/strftime v1.1.0 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/lightstep/go-expohisto v1.0.0 // indirect
github.com/linkedin/goavro/v2 v2.13.0 // indirect
Expand Down Expand Up @@ -671,7 +671,7 @@ require (
github.com/open-telemetry/otel-arrow v0.25.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/opencontainers/runc v1.1.13 // indirect
github.com/opencontainers/runc v1.1.14 // indirect
github.com/opencontainers/runtime-spec v1.2.0 // indirect
github.com/opencontainers/selinux v1.10.0 // indirect
github.com/opensearch-project/opensearch-go/v2 v2.3.0 // indirect
Expand Down
8 changes: 4 additions & 4 deletions cmd/otelcontribcol/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion exporter/elasticsearchexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/elastic/go-docappender/v2 v2.3.0
github.com/elastic/go-elasticsearch/v7 v7.17.10
github.com/elastic/go-structform v0.0.12
github.com/lestrrat-go/strftime v1.0.6
github.com/lestrrat-go/strftime v1.1.0
github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.108.0
github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.108.0
github.com/stretchr/testify v1.9.0
Expand Down
4 changes: 2 additions & 2 deletions exporter/elasticsearchexporter/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion exporter/elasticsearchexporter/integrationtest/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ require (
github.com/knadh/koanf/v2 v2.1.1 // indirect
github.com/leodido/go-syslog/v4 v4.1.0 // indirect
github.com/leodido/ragel-machinery v0.0.0-20190525184631-5f46317e436b // indirect
github.com/lestrrat-go/strftime v1.0.6 // indirect
github.com/lestrrat-go/strftime v1.1.0 // indirect
github.com/lightstep/go-expohisto v1.0.0 // indirect
github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect
github.com/magefile/mage v1.15.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions exporter/elasticsearchexporter/integrationtest/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions exporter/googlemanagedprometheusexporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,21 @@ logic from OpenTelemetry resource to Google Cloud's `prometheus_target`
monitored resouce didn't preserve a resource attribute that was needed to
distinguish timeseries. This can be mitigated by adding resource
attributes as metric labels using `resource_filters` configuration in the
exporter:
exporter. The following example adds common identifying resource attributes.
You may need to expand this list with other resource attributes to fix
duplicate timeseries errors:

```yaml
googlemanagedprometheus:
metric:
resource_filters:
regex: ".*"
- prefix: "cloud"
- prefix: "k8s"
- prefix: "faas"
- regex: "container.id"
- regex: "process.pid"
- regex: "host.name"
- regex: "host.id"
```

If you need to troubleshoot errors further, start by filtering down to a single
Expand Down
24 changes: 24 additions & 0 deletions exporter/googlemanagedprometheusexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"testing"
"time"

"github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/collector"
"github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/collector/googlemanagedprometheus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -54,6 +55,29 @@ func TestLoadConfig(t *testing.T) {
},
},
Prefix: "my-metric-domain.com",
ResourceFilters: []collector.ResourceFilter{
{
Prefix: "cloud",
},
{
Prefix: "k8s",
},
{
Prefix: "faas",
},
{
Regex: "container.id",
},
{
Regex: "process.pid",
},
{
Regex: "host.name",
},
{
Regex: "host.id",
},
},
},
},
QueueSettings: exporterhelper.QueueSettings{
Expand Down
8 changes: 8 additions & 0 deletions exporter/googlemanagedprometheusexporter/testdata/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ exporters:
extra_metrics_config:
enable_target_info: false
enable_scope_info: false
resource_filters:
- prefix: "cloud"
- prefix: "k8s"
- prefix: "faas"
- regex: "container.id"
- regex: "process.pid"
- regex: "host.name"
- regex: "host.id"


service:
Expand Down
5 changes: 4 additions & 1 deletion pkg/stanza/fileconsumer/matcher/internal/finder/finder.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package finder // import "github.com/open-telemetry/opentelemetry-collector-cont
import (
"errors"
"fmt"
"slices"

"github.com/bmatcuk/doublestar/v4"
"golang.org/x/exp/maps"
Expand Down Expand Up @@ -46,5 +47,7 @@ func FindFiles(includes []string, excludes []string) ([]string, error) {
}
}

return maps.Keys(allSet), errs
keys := maps.Keys(allSet)
slices.Sort(keys)
return keys, errs
}

0 comments on commit c583bab

Please sign in to comment.