Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK: post-request vs immediate export #8

Closed
fbogsany opened this issue May 31, 2019 · 2 comments
Closed

SDK: post-request vs immediate export #8

fbogsany opened this issue May 31, 2019 · 2 comments

Comments

@fbogsany
Copy link
Contributor

The OpenCensus gem buffers spans during a request (for Rack apps) and exports them when the request has completed. This means finished child spans of long requests will not be available for analysis until the request finishes.

Should we wait for request completion to export all child spans, or should spans be exported as they finish?

@benedictfischer09
Copy link

I would think the agent should operate in its own thread or process and have no knowledge of the thread that generated the span, whether that is a http request or some other process like a background job. As spans are placed onto the buffer in the agent thread it should have some strategy for flushing the buffer, probably a combination of hitting a max number of messages or a max time delay.

@fbogsany
Copy link
Contributor Author

fbogsany commented Sep 9, 2019

The spec is clear on non blocking requirements around span export. The supporting mechanism will be BatchSampledSpanProcessor, for exporters that want to export batches asynchronously.

@fbogsany fbogsany closed this as completed Sep 9, 2019
fbogsany pushed a commit that referenced this issue Mar 11, 2021
* fix: http example script now reference local common lib

Prior to this change the examples would fail to run because it was not able to resolve dependencies:

```
$> docker-compose run ex-http

Creating opentelemetry-ruby_ex-http_run ... done
Bundler could not find compatible versions for gem "opentelemetry-common":
  In Gemfile:
    opentelemetry-sdk was resolved to 0.15.0, which depends on
      opentelemetry-common (~> 0.15.0)
Could not find gem 'opentelemetry-common (~> 0.15.0)', which is required by gem 'opentelemetry-sdk', in any of the sources.
```

After this change you will be able to run ex-http, however it is not configured with any exporters so you will not see any output.

```
$> docker-compose run ex-http

Creating opentelemetry-ruby_ex-http_run ... done
W, [2021-03-10T18:06:25.143371 #8]  WARN -- : The otlp exporter cannot be configured - please add opentelemetry-exporter-otlp to your Gemfile, spans will not be exported
[2021-03-10 18:06:25] INFO  WEBrick 1.4.2
[2021-03-10 18:06:25] INFO  ruby 2.6.5 (2019-10-01) [x86_64-linux-musl]
== Sinatra (v2.0.7) has taken the stage on 4567 for development with backup from WEBrick
[2021-03-10 18:06:25] INFO  WEBrick::HTTPServer#start: pid=8 port=4567
bash-5.0$ ./client.rb
W, [2021-03-10T18:06:32.805906 #12]  WARN -- : The otlp exporter cannot be configured - please add opentelemetry-exporter-otlp to your Gemfile, spans will not be exported
127.0.0.1 - - [10/Mar/2021:18:06:32 UTC] "GET /hello HTTP/1.1" 200 12
- -> /hello
bash-5.0$
```

It is still the case that some of the examples have errors but I will address those in separate PRs

For more details see https://cloud-native.slack.com/archives/C01NWKKMKMY/p1615385309053200

* Extract rules into a shared file

* Address Linter Issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants