Skip to content

Resource labels and custom metrics labels are missing from tessera metrics #452

@cmurphy

Description

@cmurphy

Description

Tessera metrics are missing three of the six resource labels described here:

https://cloud.google.com/stackdriver/docs/managed-prometheus/setup-otel#detect-resource-attributes

Image

The defined-by-us metric attribute service.version does not appear in these metrics. Though it looks like service.name is working, that might be getting populated by the PodMonitoring config. Adding other attributes like Hostname does not populate the label in the metrics explorer.

The attributes set at the metric-level by tessera itself are working.

Consequences

This means it is not possible to filter or aggregate tessera metrics by any of these attributes, which means it is impossible to tell when a metric arises from one shard or another or one revision or another:

Image

There are also an extreme number of "TimeSeries could not be written...Points must be written in order. One or more of the points specified had an older start time than the most recent point." spamming the logs, which is another potential effect of this misconfiguration.

Mitigation

I can get the service_instance_id and service_namespace attributes to appear by setting OTEL_RESOURCE_ATTRIBUTES in the deployment. But I did not have luck setting k8s.namespace_name or getting namespace, job, or instance to appear as resource attributes.

Next steps

I'm filing this issue because the documentation on exporting custom metrics from GKE to Managed Prometheus is murky and does not seem straightforward.

We might need to set up Managed Collection for finer-grained attribute labeling.

It might be possible to coax the PodMonitoring resource to do this advanced metric relabeling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    Status

    Todo

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions