Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Documentation on tag key restrictions do not match Stackdriver. #666

Open
kunalq opened this issue Apr 11, 2019 · 1 comment
Open

Documentation on tag key restrictions do not match Stackdriver. #666

kunalq opened this issue Apr 11, 2019 · 1 comment

Comments

@kunalq
Copy link
Contributor

kunalq commented Apr 11, 2019

The documentation states that valid ASCII printable characters "between 32 and 126, inclusive" are valid tag keys for metrics; in fact, Stackdriver appears to accept only alphanumeric characters.

I received the following error when attempting to include forward slashes in the label (to match our tracing labels):

Apr 11, 2019 1:40:29 PM io.opencensus.exporter.stats.stackdriver.StackdriverExporterWorker registerMetricDescriptor
WARNING: ApiException thrown when creating MetricDescriptor.
com.google.api.gax.rpc.InvalidArgumentException: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Field metricDescriptor.labels[0].key had an invalid value of "foo/bar": Label key contains invalid characters.
        at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:49)
        at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:72)
        at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:60)
        at com.google.api.gax.grpc.GrpcExceptionCallable$ExceptionTransformingFuture.onFailure(GrpcExceptionCallable.java:97)
        at com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:68)
        at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1052)
        at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:398)
[snip]

Doc in question: https://github.com/census-instrumentation/opencensus-website/blob/master/content/tag/key.md

@songy23
Copy link
Contributor

songy23 commented Apr 11, 2019

The characters that you can use in OpenCensus tags are a superset (not subset) of the ones in Stackdriver/Prometheus. If you know all your metrics will only be exported to Stackdriver, please conform to Stackdriver restrictions when creating tags.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants