Comments (15)
Hi @ChrisBartonLC , this error is probably because you updated your view definition after exporting it to Stackdriver Monitoring. Currently our exporter doesn't support updating a view (or creating a new view with existing names). For now please try deleting the conflicted metric descriptors from Stackdriver before exporting.
from opencensus-go.
This is coming from CreateMetricDescriptor if the metric descriptor is just newly created. Needs more investigation...
from opencensus-go.
I suppose #162 should fix this? For Stackdriver, it's ok to create the exact same metric descriptor multiple times, however we'll get an AlreadyExists error if we try to create a metric descriptor that has the same name but with different attributes (e.g aggregation or window).
from opencensus-go.
I cannot reproduce it anymore hence closing, I will reopen it if I see it again.
from opencensus-go.
We get the following errors:
2018/04/03 07:02:37 Failed to export to Stackdriver Monitoring: rpc error: code = AlreadyExists desc = Errors during metric descriptor creation: {(metric: custom.googleapis.com/opencensus/cloud.google.com/go/pubsub/stream_request_count, error: The metric already exists.)}.
2018/04/03 07:02:47 Failed to export to Stackdriver Monitoring: rpc error: code = AlreadyExists desc = Errors during metric descriptor creation: {(metric: custom.googleapis.com/opencensus/cloud.google.com/go/pubsub/stream_response_count, error: The metric already exists.)}.
2018/04/03 06:59:33 Failed to export to Stackdriver Monitoring: rpc error: code = AlreadyExists desc = Errors during metric descriptor creation: {(metric: custom.googleapis.com/opencensus/cloud.google.com/go/pubsub/stream_open_count, error: The metric already exists.)}.
When using code like this with go.opencensus.io master and cloud.google.com/go master deps:
stackdriverExporter, err := stackdriver.NewExporter(stackdriver.Options{ProjectID: os.Getenv("GCP_PROJECT_ID")})
if err != nil {
share_log.Logger.Fatal(ctx, "Failed initializing statistics - opencensus", share_log.Logger.FmtError(err))
}
view.RegisterExporter(stackdriverExporter)
trace.RegisterExporter(stackdriverExporter)
for _, v := range []*view.View{
pubsub.PullCountView,
pubsub.AckCountView,
pubsub.NackCountView,
pubsub.ModAckCountView,
pubsub.StreamOpenCountView,
pubsub.StreamRetryCountView,
pubsub.StreamRequestCountView,
pubsub.StreamResponseCountView,
} {
if err := v.Subscribe(); err != nil {
share_log.Logger.Fatal(ctx, "Failed subscribing to statistics view - opencensus", share_log.Logger.FmtError(err))
}
share_log.Logger.Info(ctx, "Subscribed to statistics view - opencensus", share_log.Logger.FmtString("View", v.Name))
}
share_log.Logger.Info(ctx, "Initialized statistics - opencensus")
from opencensus-go.
Ok deleted them after modifying the demo code from "google.golang.org/api/monitoring/v3" to "monitoring "google.golang.org/api/monitoring/v3" and now the error is:
Failed to export to Stackdriver Monitoring: stackdriver metric descriptor was not created with aggregation type view.AggType
from opencensus-go.
@ChrisBartonLC Thanks for reporting, this is related to a recent change to Aggregation. #664 should fix it.
from opencensus-go.
Thanks! Works now after using your latest code on master :)
from opencensus-go.
Hi I updated this morning and swapped to to using the new 'register' api for setting up the view.
Unfortunately I can no longer delete metrics even though the delete does not return an error:
INFO 2018/04/05 09:01:31.888517 BACKGROUND Deleting metric { "metric": "projects/localcover-55/metricDescriptors/custom.googleapis.com/opencensus/cloud.google.com/go/pubsub/stream_request_count" } main.main line 64 /Users/tanh/projects/localcover/dev/code_lc/lc/lc-api/lc-api-customer/src/lc-api-customer/tools/stackdriver-metric-delete/main.go
INFO 2018/04/05 09:01:34.330270 BACKGROUND Deleted metric { "metric": "projects/localcover-55/metricDescriptors/custom.googleapis.com/opencensus/cloud.google.com/go/pubsub/stream_request_count", "response": {} } main.main line 71 /Users/tanh/projects/localcover/dev/code_lc/lc/lc-api/lc-api-customer/src/lc-api-customer/tools/stackdriver-metric-delete/main.go
Metric still exists:
2018/04/05 09:00:45 Failed to export to Stackdriver Monitoring: rpc error: code = AlreadyExists desc = Errors during metric descriptor creation: {(metric: custom.googleapis.com/opencensus/cloud.google.com/go/pubsub/stream_request_count, error: The metric already exists.)}.
from opencensus-go.
Hi @ChrisBartonLC , can you show us how you defined StreamRequestCountView
?
from opencensus-go.
stackdriverExporter, err := stackdriver.NewExporter(stackdriver.Options{ProjectID: os.Getenv("GCP_PROJECT_ID")})
if err != nil {
share_log.Logger.Fatal(ctx, "Failed initializing stackdriver", share_log.Logger.FmtError(err))
}
trace.RegisterExporter(stackdriverExporter)
share_log.Logger.Info(ctx, "Registered stackdriver tracing")
view.RegisterExporter(stackdriverExporter)
if err := view.Register(
pubsub.PullCountView,
pubsub.AckCountView,
pubsub.NackCountView,
pubsub.ModAckCountView,
pubsub.StreamOpenCountView,
pubsub.StreamRetryCountView,
pubsub.StreamRequestCountView,
pubsub.StreamResponseCountView,
); err != nil {
share_log.Logger.Fatal(ctx, "Failed registering stackdriver statistics", share_log.Logger.FmtError(err))
}
share_log.Logger.Info(ctx, "Registered stackdriver statistics")
from opencensus-go.
Is this issue specific to StreamRequestCountView
, or all other views have the same issue?
I suspect this is because StreamRequestCountView
is registered somewhere more than once and have different definitions. Might be related to
googleapis/google-cloud-go@b475e33#diff-38bb0d2f62f8d9a759252a81a1086486?
/cc @rakyll
from opencensus-go.
Yep we are only getting errors related to StreamRequestCountView.
Here are all the metrics from "https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors/list" using the filter "metric.type = starts_with("custom.googleapis.com/")"
{
"metricDescriptors": [
{
"name": "projects/localcover-55/metricDescriptors/custom.googleapis.com/opencensus/cloud.google.com/go/pubsub/ack_count",
"labels": [
{
"key": "subscription"
},
{
"key": "opencensus_task",
"description": "Opencensus task identifier"
}
],
"metricKind": "CUMULATIVE",
"valueType": "INT64",
"unit": "1",
"description": "Number of PubSub messages acked",
"displayName": "OpenCensus/cloud.google.com/go/pubsub/ack_count",
"type": "custom.googleapis.com/opencensus/cloud.google.com/go/pubsub/ack_count"
},
{
"name": "projects/localcover-55/metricDescriptors/custom.googleapis.com/opencensus/cloud.google.com/go/pubsub/mod_ack_count",
"labels": [
{
"key": "subscription"
},
{
"key": "opencensus_task",
"description": "Opencensus task identifier"
}
],
"metricKind": "CUMULATIVE",
"valueType": "INT64",
"unit": "1",
"description": "Number of ack-deadlines modified",
"displayName": "OpenCensus/cloud.google.com/go/pubsub/mod_ack_count",
"type": "custom.googleapis.com/opencensus/cloud.google.com/go/pubsub/mod_ack_count"
},
{
"name": "projects/localcover-55/metricDescriptors/custom.googleapis.com/opencensus/cloud.google.com/go/pubsub/nack_count",
"labels": [
{
"key": "subscription"
},
{
"key": "opencensus_task",
"description": "Opencensus task identifier"
}
],
"metricKind": "CUMULATIVE",
"valueType": "INT64",
"unit": "1",
"description": "Number of PubSub messages nacked",
"displayName": "OpenCensus/cloud.google.com/go/pubsub/nack_count",
"type": "custom.googleapis.com/opencensus/cloud.google.com/go/pubsub/nack_count"
},
{
"name": "projects/localcover-55/metricDescriptors/custom.googleapis.com/opencensus/cloud.google.com/go/pubsub/pull_count",
"labels": [
{
"key": "subscription"
},
{
"key": "opencensus_task",
"description": "Opencensus task identifier"
}
],
"metricKind": "CUMULATIVE",
"valueType": "INT64",
"unit": "1",
"description": "Number of PubSub messages pulled",
"displayName": "OpenCensus/cloud.google.com/go/pubsub/pull_count",
"type": "custom.googleapis.com/opencensus/cloud.google.com/go/pubsub/pull_count"
},
{
"name": "projects/localcover-55/metricDescriptors/custom.googleapis.com/opencensus/cloud.google.com/go/pubsub/stream_open_count",
"labels": [
{
"key": "subscription"
},
{
"key": "opencensus_task",
"description": "Opencensus task identifier"
}
],
"metricKind": "CUMULATIVE",
"valueType": "INT64",
"unit": "1",
"description": "Number of calls opening a new streaming pull",
"displayName": "OpenCensus/cloud.google.com/go/pubsub/stream_open_count",
"type": "custom.googleapis.com/opencensus/cloud.google.com/go/pubsub/stream_open_count"
},
{
"name": "projects/localcover-55/metricDescriptors/custom.googleapis.com/opencensus/cloud.google.com/go/pubsub/stream_request_count",
"labels": [
{
"key": "subscription"
},
{
"key": "opencensus_task",
"description": "Opencensus task identifier"
}
],
"metricKind": "CUMULATIVE",
"valueType": "INT64",
"unit": "1",
"description": "Number gRPC StreamingPull request messages sent",
"displayName": "OpenCensus/cloud.google.com/go/pubsub/stream_request_count",
"type": "custom.googleapis.com/opencensus/cloud.google.com/go/pubsub/stream_request_count"
},
{
"name": "projects/localcover-55/metricDescriptors/custom.googleapis.com/opencensus/cloud.google.com/go/pubsub/stream_response_count",
"labels": [
{
"key": "subscription"
},
{
"key": "opencensus_task",
"description": "Opencensus task identifier"
}
],
"metricKind": "CUMULATIVE",
"valueType": "INT64",
"unit": "1",
"description": "Number of gRPC StreamingPull response messages received",
"displayName": "OpenCensus/cloud.google.com/go/pubsub/stream_response_count",
"type": "custom.googleapis.com/opencensus/cloud.google.com/go/pubsub/stream_response_count"
},
{
"name": "projects/localcover-55/metricDescriptors/custom.googleapis.com/opencensus/cloud.google.com/go/pubsub/stream_retry_count",
"labels": [
{
"key": "subscription"
},
{
"key": "opencensus_task",
"description": "Opencensus task identifier"
}
],
"metricKind": "CUMULATIVE",
"valueType": "INT64",
"unit": "1",
"description": "Number of retries of a stream send or receive",
"displayName": "OpenCensus/cloud.google.com/go/pubsub/stream_retry_count",
"type": "custom.googleapis.com/opencensus/cloud.google.com/go/pubsub/stream_retry_count"
},
{
"name": "projects/localcover-55/metricDescriptors/custom.googleapis.com/opencensus/grpc.io/client/error_count/cumulative",
"labels": [
{
"key": "canonical_status"
},
{
"key": "method"
},
{
"key": "opencensus_task",
"description": "Opencensus task identifier"
}
],
"metricKind": "CUMULATIVE",
"valueType": "DISTRIBUTION",
"unit": "1",
"description": "RPC Errors",
"displayName": "OpenCensus/grpc.io/client/error_count/cumulative",
"type": "custom.googleapis.com/opencensus/grpc.io/client/error_count/cumulative"
},
{
"name": "projects/localcover-55/metricDescriptors/custom.googleapis.com/opencensus/grpc.io/client/request_count/cumulative",
"labels": [
{
"key": "method"
},
{
"key": "opencensus_task",
"description": "Opencensus task identifier"
}
],
"metricKind": "CUMULATIVE",
"valueType": "DISTRIBUTION",
"unit": "1",
"description": "Number of client RPC request messages",
"displayName": "OpenCensus/grpc.io/client/request_count/cumulative",
"type": "custom.googleapis.com/opencensus/grpc.io/client/request_count/cumulative"
}
]
}
from opencensus-go.
Actually it is ok now, sorry :( seems another developer must have been using the old code so we kept clashing
from opencensus-go.
Cool :)
from opencensus-go.
Related Issues (20)
- Remove rakyll from being an auto-assignee for reviews HOT 3
- metric: document how to use the Registry and export metrics out HOT 1
- Test_Worker_MultiExport intermittently fails: Mismatched value
- Defining stats and views for dynamically created endpoints HOT 4
- stats: defaultWorker can not be stopped HOT 1
- [ochttp] KeyClientHost tag doesn't change in exported Prometheus metrics
- compile error HOT 1
- Improve performance of stats recording HOT 6
- Tracestate header not generated or mutated
- race condition inside opencensus ochttp when used inside google storage API
- ProbabilitySampler always sample when incoming trace-id is 64-bit (B3/Jaeger)
- Span name with stack trace
- Tag has concurrent access problem
- Is there a function or way to transfor `view.Data` to `WriteRequest` HOT 2
- Testify needs updating due to DOS and Null ptr dereference - plz update testify to >= 1.7.5
- Security issue: recording query params insecure (tokens) HOT 7
- Panic when running stats.Record without importing the view package
- ochttp.Handler.ServeHTTP func param r * http.Request did not modify r.MultipartForm correctly HOT 3
- Hash pin github workflow dependencies
- Memory statistics never collected unless UseDerivedCumulative is used
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opencensus-go.