Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 08:49

    g-easy on master

    Allow build with other than C++… (compare)

  • 08:49
    g-easy closed #392
  • 08:47
    g-easy commented #392
  • 08:46
    bitomaxsp commented #392
  • 08:41
    googlebot commented #392
  • 08:41
    bitomaxsp synchronize #392
  • 08:35
    bitomaxsp commented #392
  • 08:30
    g-easy commented #392
  • 08:18
    bitomaxsp commented #392
  • 08:08
    g-easy commented #392
  • 07:56
    googlebot commented #392
  • 07:56
    bitomaxsp review_requested #392
  • 07:56
    bitomaxsp review_requested #392
  • 07:56
    bitomaxsp review_requested #392
  • 07:56
    bitomaxsp opened #392
  • 07:29
    g-easy commented #294
  • 03:20

    g-easy on master

    Add OcAgentOptions override for… (compare)

  • 03:20
    g-easy closed #391
  • 03:20
    nicktrav commented #1980
  • 03:18
    nicktrav opened #1980
Alex Leong
@adleong
I'm seeing some weird traces with the Go client library + oc-collector + jaeger. I've got a coupld of gRPC calls which should definitely be happening in series but the trace shows them happening in parallel. I'm wondering if I'm somehow using the go library wrong and span start times are getting calculated wrong
for each outbound request I make, I'm passing in r.Context() where r is the incoming request. does that sound right? unfortunately I couldn't find any good code examples... the hello world example is not that useful because it's just a client and server rather than a service that propagates trace context from an incoming request to an outgoing one
Alex Leong
@adleong
could this be an interoperability issue between the ochttp and ocgrpc packages? my service receives HTTP requests (and uses the ochttp.Handler) but sends gRPC requests (and uses the ocgrpc.ClientHandler)
mostly, I just wish there were more extensive examples to look at
TDesai01
@TDesai01

@songy23 Question to your previous comment: "@TDesai01 You need to specify a cert-perm-file in your config, under exporter:opencensus: section. See https://github.com/census-instrumentation/opencensus-service/blob/master/exporter/opencensusexporter/config.go#L30."

Why the exporter section need to be configured with cert-perm-file and not receiver? As per documentation, receiver is the one who receives trace data at OCAgent.

TDesai01
@TDesai01

@songy23 : I changed oc-agent-config.yaml to this:

receivers:
  opencensus:
    address: "0.0.0.0:55678"

  jaeger:
    collector_http_port: 14268

exporters:
  opencensus:
    endpoint: "oc-collector:55678"
    headers: {"X-test-header": "test-header"}
    compression: "gzip"
    cert-pem-file: /etc/server.pem # optional to enable TLS
    reconnection-delay: 2s

and Java Client code is like this:

    SslContext ctx = SslContextBuilder.forClient()
        .trustManager(InsecureTrustManagerFactory.INSTANCE)
        .startTls(true).build();

        OcAgentTraceExporterConfiguration ocAgentConfig = OcAgentTraceExporterConfiguration.builder()
                .setEndPoint("0.0.0.0:55678")
        .setServiceName("exampleDemo")
        .setUseInsecure(true)
        .setSslContext(ctx)
                .setEnableConfig(true).build();
    OcAgentTraceExporter.createAndRegister(ocAgentConfig);

But it didn't export my traces to OCAgent. Any Idea??

TDesai01
@TDesai01
@songy23: As shown above, we are just configuring certificate pem file at exporter for TLS/SSL communication. Where to configure keyPairs (private key & public key)?
Yang Song
@songy23
@TDesai01 Apologies, I just checked the code, it turns out the opencensus receiver is always using insecure: https://github.com/census-instrumentation/opencensus-service/blob/35b1e1c180c88c7cd5b08475fd522e10c57f406c/receiver/opencensusreceiver/opencensus.go#L254. IIUC for using TLS you'll need to configure it on both sides, so if client (a.k.a the Java OcAgentTraceExporter and the exporter on Agent) is using TLS but server (a.k.a opencensus receiver) is not, traces will probably be dropped. So for now you cannot use TLS for opencensus-service.
Note this config has been added to opentelemetry-service: https://github.com/open-telemetry/opentelemetry-service/blob/master/receiver/opencensusreceiver/config.go#L33. I'd suggest to use opentelemetry-service instead.
TDesai01
@TDesai01

@songy23 Thanks for your reply. Meanwhile I checked the code and found that there is a TLSCredentials in receiver configuration at https://github.com/census-instrumentation/opencensus-service/blob/master/internal/config/config.go like:

type ReceiverConfig struct {
    ....
    .....

    // TLSCredentials is a (cert_file, key_file) configuration.
    TLSCredentials *TLSCredentials `mapstructure:"tls_credentials"`
}

So I used this receiver config in OC-Agent.yaml file to configure cert_file & key_file like this:

receivers:
  opencensus:
    address: "0.0.0.0:55678"
    tls_credentials:
      cert_file: /etc/oc-agent.pem
      key_file: /etc/oc-agent.key

Although clientLib could not connect to OCAgent over SSL. Now I am confused that it is because of some miss configuration or as you mentioned earlier it is simply not possible to do SSL between clientLIb->OCAgent. Could you please again verify.

TDesai01
@TDesai01
@songy23 I am not good with Go language. so could you please once more verify before I move to Opentelemestry.
Yang Song
@songy23
This config looks correct. I forgot in v1 config TLS is in the common config. Note in opentelemetry-service the config format has been changed slightly.
TDesai01
@TDesai01
@songy23 TLS should work between OCClientLib and OCAgent (Receiver), right?? I do not need to move to OpenTelemetry.
Yang Song
@songy23
It should work. The point I'm trying to make here is if you're a first-time user, it may be better to just start with OpenTelemetry-Service. OpenCensus-Service is deprecated and eventually all existing users are expected to move to OpenTelemetry-Service.
TDesai01
@TDesai01
Thanks for your input.
Ilya Figotin
@ifigotin
Hi All,
I'm trying to set up OpenCensus WEB, and see if I can collect info about initial page loads. Following the docs, I see this "We also suggest that you create an endpoint in the server that receives the HTTP/JSON traces and proxies to the OpenCensus Agent." I'd like to go this route, but cannot find any docs or samples about how to process the requests coming into that endpoint. Could anybody point me in the right direction? (Note: I also posted the question on open-telemtry, but it seems like this room is more appropriate).
TDesai01
@TDesai01

@songy23 @all : I have following Maben dependency in my test program running with Java 1.8 on windows10.

opencensus-api 0.22.0 opencensus-impl 0.22.0 opencensus-exporter-trace-ocagent 0.22.0 opencensus-contrib-zpages 0.22.1 netty-tcnative-boringssl-static 2.0.20.Final (windows-x86_64 & runtime) guava 23.0 gson 2.8.2

The java Client for OCAgent (OcAgentTraceExporter) is giving this Exception:


Sep 06, 2019 6:35:23 PM io.opencensus.exporter.trace.util.TimeLimitedHandler handleException
WARNING: Failed to export traces: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalArgumentException: ALPN must be enabled and list HTTP/2 as a supported protocol.

I have tried this on Java 10 & 12, but same error. Any idea what's going wrong here??

Yang Song
@songy23

@TDesai01 Did a bit of search. This may be related to grpc/grpc-java#5543 and grpc/grpc#18645. It seems to be a known issue:

The root problem is that TLS terminators don't support HTTP/2, architecturally. This isn't a grpc-specific problem.

Nicolas Ha
@nha
I have <trace-without-root-span> and nothing inside showing up in my Jaeger UI, using opencensus. I think (not sure) that I am using spanBuilderWithRemoteParent incorrectly. Could is cause this behavior?
TDesai01
@TDesai01

@songy23 @all: I have initialized OcAgentTraceExporter as follows and wanted to do SSL/TLS between OCClientLib -> OCAgent.

    SslContext ctx =  GrpcSslContexts.forClient()
      .trustManager(new File(args[0]))
      .build();

    OcAgentTraceExporterConfiguration ocAgentConfig = OcAgentTraceExporterConfiguration.builder()
      .setEndPoint("0.0.0.0:55678")
      .setServiceName("exampleDemo")
      .setUseInsecure(false)
      .setSslContext(ctx).setEnableConfig(true).build();
    OcAgentTraceExporter.createAndRegister(ocAgentConfig);

But I am getting this:


Caused by: io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record: 485454502f312e31203430302042616420526571756573740d0a436f6e74656e742d547970653a20746578742f706c61696e3b20636861727365743d7574662d380d0a436f6e6e656374696f6e3a20636c6f73650d0a0d0a343030204261642052657175657374
    at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1206)
    at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1274)

It look like this code is doing http instead of https, how to set here https? Any Idea?

TDesai01
@TDesai01
These are my OC-Agent & collector Configs & docker-compose
TDesai01
@TDesai01

@songy23: finally I found that this TLS communication is a BUG in Opencensus service.

line no:271-281 in https://github.com/census-instrumentation/opencensus-service/blob/35b1e1c180c88c7cd5b08475fd522e10c57f406c/receiver/opencensusreceiver/opencensus.go

OC-Agent implementation is based on request header "content-type: application/grpc" & "content-type: application/grpc+proto", which means if OC-Agent finds any of these header in incoming request, then it starts GRPC Server, otherwise HTTP server. As per current implementation of OC-Agent, only GRPC Server support TLS (HTTP Server is not supporting TLS) communication. Also, there is no way with Opencensus Java Client library to set this HTTP request headers(“grpc”) and thus we could not continue here.

I don't know, how to create bug ticket on this.
Can I expect a fix on this in coming days?
Bradley Weston
@bweston92
Dave Protasowski
@dprotaso

I'm having some trouble finding - is there a generic open census equivalent to the prom go collector - https://github.com/prometheus/client_golang/blob/master/prometheus/go_collector.go

It essentially just exports golang runtime metrics

Yang Song
@songy23
Thanks for the investigation @TDesai01. I filed census-instrumentation/opencensus-service#623 to keep track.
Nicolas Ha
@nha
Hello, does anyone know what is the best way to get access to the stored traces programmatically? Would you recommend a specific backend (probably not the right terminology here, maybe storage collector?) for that purpose?
Dave Protasowski
@dprotaso
Alexandre Thenorio
@alethenorio

Evening. When you configure tracing with a certain sample rate (For example 5%) for microservices, I notice that I see traces with spans involving only certain services along the chain and I guess this is because one service decided to sample that request while another one didnt. It feels a bit strange to have a bunch of traces which only comprise of part of the entire end-to-end call.

Is this intended behaviour? Is there any way around it?

Jonas Kunz
@JonasKunz

Hi,
I have a question regarding the inheritance of trace sampling decisions.
I assumed that the sampling decision of the parent span is always inherited by the child span.
E.g, if the root span decided "yes", the child spans will all be sampled. If the root span decided "no", no child-spans will be sampled.

However, in the OC-Java implementation child spans only inherit the sampling decision in case of a "yes" decision:
https://github.com/census-instrumentation/opencensus-java/blob/660e8f375bb483a3eb817940b3aa8534f86da314/api/src/main/java/io/opencensus/trace/samplers/ProbabilitySampler.java#L82

Is this a bug or is it how it is supposed to work?

@alethenorio I guess your question Is related to mine from a few days ago.
There the answer was that this behaviour is intentional. In order to achieve the behaviour of child-spans always inheriting the parent sampling decision a custom sampler needs to be implemented and used.

Alexandre Thenorio
@alethenorio
@JonasKunz Thank you for the answer. I'll look into it
aparicio-ronald
@aparicio-ronald
hello, I'm a computer science student, I was looking over this software and see that you guys are a pretty active community. I'm not the best software developer but was wondering in some good entry points in contributing.
Paulo Janotti
@pjanotti
@aparicio-ronald you can search on the github issues labeled good first issue, up-for-grabs, or help wanted (the label names vary a bit on each project). Choose a language that you are comfortable and start with those repos, look at the PRs and see the typical comments to get familiar with the reviews on the repo. One suggestion: look at the OpenTelemetry projects too, it is the future of OpenCensus ;)
aparicio-ronald
@aparicio-ronald
thanks, @pjanotti I will look into it also I was wondering if there are any new issues to the software is there like an issue form for users to submit or they usually just reach out to you guys through email or any other messaging way.
Paulo Janotti
@pjanotti
usually issues are filed directly on the repos but if people are not sure they typically ask before here on gitter - direct messages typically only after initial public discussion/issue that requires some back and forth that is not productive to the public forum (either on gitter or github).
Alexandre Thenorio
@alethenorio

@JonasKunz I have run upon this page https://opencensus.io/tracing/sampling/#1 which says this

A sampling decision from a ParentSpan is ALWAYS inherited by all its regardless of the trace configuration. This ensures continuity of traces – for example, if a parent were sampled but one of its children were not, we’d then lose parts of the trace, and vice versa if the parent weren’t sampled yet one of its children were, we wouldn’t know where the span began

Is this meant to explain how all samplers work? If so did I miss anything?

Alexandre Thenorio
@alethenorio
I can confirm that child spans will be sampled of parent spans are sampled however there is something that is making it not work and sometimes the parent sample does not show in the UI
Jonas Kunz
@JonasKunz
@alethenorio I also stumbled across this part of the documentation. However the implementation does not match it.
At least in the Java implementation, only "yes" decisions are inherited. E.g. if one parent decides to sample, all child spans will also be sampled.
In case a parent decides with "no", the decision is not inherited: child spans will role the dice again, which might be why you see child spans with their parent missing.
Tarun Pothulapati
@Pothulapati
Hello Everyone, I see that in this doc it was mentioned that sampling configuration can be pushed from the agent to the libraries. Is it possible now?
https://github.com/census-instrumentation/opencensus-service/blob/master/DESIGN.md#agent-communication
Zhan Su
@z-oo

Hi, I notice that Python tracing API provides a decorator in opencensus.trace.Tracer class, but it is a non-static member function. So how is it supposed to be used? If my Python knowledge works, a decorator is applied when the function is first defined. For most functions that I wish to trace, they are statically defined (i.e. they are defined once when the file is first interpreted, instead of being dynamically generated). Would that mean we can only decorate a function using a static tracer, unless we have a complicated wrapper of the decorator? For example:

class MyRequest():
  @tracer.trace_decorator()  # only a static tracer can be used here, not a self.tracer.
  def process(self):
    pass

  def process2(self):
    @self.tracer.decorator() # this should work, but the complexity of boilerplate outweighs the benefit of using decorator
    def real_process(self):
      pass

    real_process(self)

Also I have been generally confused by the role of tracer. IIUC, tracer is opencensus-python term for TraceContext which is tied to a specific request, as oppose to a static / singleton object like logging.Logger, right?

Sanjito Kurniawan
@s4nji
@songy23 Should AlwaysParentSampler sample new spans without parent?
I am adding this to opencensus-go and initially thought that it should never sample new spans without parent
But that is exactly ProbabilitySampler(0), and it would make AlwaysParentSampler implementation redundant – if this is the case, I'll close the PR
I couldn't find any spec for this, so I thought you're the best person to ask
Yang Song
@songy23
Thanks for the PR @s4nji. IMO AlwaysParentSampler should be built on top of ProbabilitySampler because AlwaysParentSampler itself doesn't specify how to sample root spans (ones without a parent). We don't have spec for AlwaysParentSampler so I'd suggest adding a spec for it first.
easy
@g-easy
this is also coming up as part of census-instrumentation/opencensus-cpp#294