OpenCensus

Custom OpenCensus metrics not appearing on Stackdriver

扶醉桌前 提交于 2020-12-12 18:14:08
问题 I'm trying to send custom metrics to Stackdriver from my Go application using OpenCensus. I've followed the guide, so the views and exporter are setup: import ( "context" "contrib.go.opencensus.io/exporter/stackdriver" "github.com/pkg/errors" "go.opencensus.io/stats" "go.opencensus.io/stats/view" "time" ) var ( apiRequestDurationMs = stats.Int64("api_request_duration", "API request duration in milliseconds", stats.UnitMilliseconds) ) func NewMetricsExporter() (*stackdriver.Exporter, error) {

Custom OpenCensus metrics not appearing on Stackdriver

☆樱花仙子☆ 提交于 2020-12-12 18:13:13
问题 I'm trying to send custom metrics to Stackdriver from my Go application using OpenCensus. I've followed the guide, so the views and exporter are setup: import ( "context" "contrib.go.opencensus.io/exporter/stackdriver" "github.com/pkg/errors" "go.opencensus.io/stats" "go.opencensus.io/stats/view" "time" ) var ( apiRequestDurationMs = stats.Int64("api_request_duration", "API request duration in milliseconds", stats.UnitMilliseconds) ) func NewMetricsExporter() (*stackdriver.Exporter, error) {

Custom OpenCensus metrics not appearing on Stackdriver

落花浮王杯 提交于 2020-12-12 18:08:11
问题 I'm trying to send custom metrics to Stackdriver from my Go application using OpenCensus. I've followed the guide, so the views and exporter are setup: import ( "context" "contrib.go.opencensus.io/exporter/stackdriver" "github.com/pkg/errors" "go.opencensus.io/stats" "go.opencensus.io/stats/view" "time" ) var ( apiRequestDurationMs = stats.Int64("api_request_duration", "API request duration in milliseconds", stats.UnitMilliseconds) ) func NewMetricsExporter() (*stackdriver.Exporter, error) {

How to tracing a request through a chain of microservices end-to-end?

喜夏-厌秋 提交于 2020-01-13 17:10:13
问题 I am using OpenCensus in Go to push tracing data to Stackdriver for calls involving a chain of 2 or more micro services and I noticed that I get many traces which contain spans only for certain services but not the entire end to end call. At the moment I attribute this to the fact that not all calls are traced (only a certain sample) and each service decides whether to trace its current span or not. Is this the way it is intended to work? Is there any way to make sure when a trace is sampled,

Tracing second generation java app engine

穿精又带淫゛_ 提交于 2019-12-13 03:29:04
问题 i'm trying to get some custom tracing and Firestore tracing added to a second generation app engine java app. Out of the box i can already see my WebServlets being called and calls to the tasks client library in my cloud console. But adding new traces is not working and also i see no traces about firestore. I tried adding new traces as according to the google and opencencus documentation try (Scope scope = tracer.spanBuilder("myTrace").startScopedSpan()) { // do some http requests } When i

How to tracing a request through a chain of microservices end-to-end?

懵懂的女人 提交于 2019-12-06 01:11:22
I am using OpenCensus in Go to push tracing data to Stackdriver for calls involving a chain of 2 or more micro services and I noticed that I get many traces which contain spans only for certain services but not the entire end to end call. At the moment I attribute this to the fact that not all calls are traced (only a certain sample) and each service decides whether to trace its current span or not. Is this the way it is intended to work? Is there any way to make sure when a trace is sampled, it is done so by all services in the call chain? Architecturally I will say when you are developing

Go微服务全链路跟踪详解

余生长醉 提交于 2019-11-30 05:14:24
在微服务架构中,调用链是漫长而复杂的,要了解其中的每个环节及其性能,你需要全链路跟踪。 它的原理很简单,你可以在每个请求开始时生成一个唯一的ID,并将其传递到整个调用链。 该ID称为 CorrelationID ¹,你可以用它来跟踪整个请求并获得各个调用环节的性能指标。简单来说有两个问题需要解决。第一,如何在应用程序内部传递ID; 第二,当你需要调用另一个微服务时,如何通过网络传递ID。 什么是OpenTracing? 现在有许多开源的分布式跟踪库可供选择,其中最受欢迎的库可能是 Zipkin ²和 Jaeger ³。 选择哪个是一个令人头疼的问题,因为你现在可以选择最受欢迎的一个,但是如果以后有一个更好的出现呢? OpenTracing ⁴可以帮你解决这个问题。它建立了一套跟踪库的通用接口,这样你的程序只需要调用这些接口而不被具体的跟踪库绑定,将来可以切换到不同的跟踪库而无需更改代码。Zipkin和Jaeger都支持OpenTracing。 如何跟踪服务器端点(server endpoints)? 在下面的程序中我使用“Zipkin”作为跟踪库,用“OpenTracing”作为通用跟踪接口。 跟踪系统中通常有四个组件,下面我用Zipkin作为示例: recorder(记录器):记录跟踪数据 Reporter (or collecting agent)(报告器或收集代理)

蚂蚁金服在云原生架构下的可观察性的探索和实践

瘦欲@ 提交于 2019-11-29 04:11:25
本文根据 8 月 11 日 SOFA Meetup#3 广州站 《蚂蚁金服在云原生架构下的可观察性的探索和实践》主题分享整理。现场回顾视频以及 PPT 查看地址见文末链接。 前言 随着应用架构往云原生的方向发展,传统监控技术已经不能满足云原生时代运维的需求,因此,可观察性的理念被引入了 IT 领域。 下面我将会就可观察性在云原生的起源,可观察性发展动力,可观察性与监控的关系,可观察性的三大支柱,社区发展方向及产品现状,以及蚂蚁金服对相关问题的理解及实践进行探讨。 才疏学浅,欢迎拍砖。 为什么云原生时代需要可观察性 可观察性的由来 在云原生语境下的可观察性这个词,最早出现于2017年7月,Cindy Sridharan 在Medium 写的一篇博客, "Monitoringand Observability"[1] 谈到了可观察性与云原生监控的关系。 而在2017年10月,来自 Pivotal 公司的Matt Stine,在接受 InfoQ 采访的时候,对云原生的定义进行了调整,将 Cloud Native Architectures 定义为具有以下六个特质: 模块化 (Modularity) (通过微服务) 可观察性 (Observability) 可部署性 (Deployability) 可测试性 (Testability) 可处理性 (Disposability) 可替换性