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

Clarify google managed prometheus troubleshooting guide #34986

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Loading