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

Opentelemetry input does not create tag from uri with http2 enabled (it's enabled by default) #9439

Closed
lecaros opened this issue Sep 27, 2024 · 2 comments
Labels

Comments

@lecaros
Copy link
Contributor

lecaros commented Sep 27, 2024

Bug Report

Describe the bug

The opentelemetry input plugin enables http2 by default.
The tag_from_uri configuration, it's not working.

To Reproduce

  • Steps to reproduce the problem:

Use the following config for the input side.

[input]
  name opentelemetry
  port 4310
  tag_from_uri true
  tag_key new_tag
  #http2 false
[output]
  name stdout
  match *

Send logs to the endpoint. The following config can be used:

[input]
  name dummy
  tag something
[output]
  name opentelemetry
  match something
  port 4310
  logs_uri /v1/logs

Excerpt from the log generated in the input side:

Fluent Bit v3.2.0
* Copyright (C) 2015-2024 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io

______ _                  _    ______ _ _           _____  __  
|  ___| |                | |   | ___ (_) |         |____ |/  | 
| |_  | |_   _  ___ _ __ | |_  | |_/ /_| |_  __   __   / /`| | 
|  _| | | | | |/ _ \ '_ \| __| | ___ \ | __| \ \ / /   \ \ | | 
| |   | | |_| |  __/ | | | |_  | |_/ / | |_   \ V /.___/ /_| |_
\_|   |_|\__,_|\___|_| |_|\__| \____/|_|\__|   \_/ \____(_)___/

[2024/09/27 17:31:08] [ info] [fluent bit] version=3.2.0, commit=ff8803f050, pid=93505
[2024/09/27 17:31:08] [ info] [storage] ver=1.1.6, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2024/09/27 17:31:08] [ info] [cmetrics] version=0.9.6
[2024/09/27 17:31:08] [ info] [ctraces ] version=0.5.6
[2024/09/27 17:31:08] [ info] [input:opentelemetry:opentelemetry.0] initializing
[2024/09/27 17:31:08] [ info] [input:opentelemetry:opentelemetry.0] storage_strategy='memory' (memory only)
[2024/09/27 17:31:08] [ info] [input:opentelemetry:opentelemetry.0] listening on 0.0.0.0:4310
[2024/09/27 17:31:08] [ info] [output:stdout:stdout.0] worker #0 started
[2024/09/27 17:31:08] [ info] [sp] stream processor started
[0] opentelemetry.0: [[-1.000000000, {"schema"=>"otlp", "resource_id"=>0, "scope_id"=>0}], {"resource"=>{}, "schema_url"=>"", "scope"=>{}}]
[1] opentelemetry.0: [[1727469075.1775598069, {"otlp"=>{"observed_timestamp"=>0, "timestamp"=>1727469075821269000, "trace_flags"=>0}}], {"message"=>"dummy"}]
[2] opentelemetry.0: [[-2.000000000, {}], {}]
^[[A^[[A^[[B^C[2024/09/27 17:31:29] [engine] caught signal (SIGINT)
[2024/09/27 17:31:29] [ info] [output:stdout:stdout.0] thread worker #0 stopping...
[2024/09/27 17:31:29] [ info] [output:stdout:stdout.0] thread worker #0 stopped

Expected behavior

The records should have the tag assigned from the URI. In this case v1_logs.

Fluent Bit v3.2.0
* Copyright (C) 2015-2024 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io

______ _                  _    ______ _ _           _____  __  
|  ___| |                | |   | ___ (_) |         |____ |/  | 
| |_  | |_   _  ___ _ __ | |_  | |_/ /_| |_  __   __   / /`| | 
|  _| | | | | |/ _ \ '_ \| __| | ___ \ | __| \ \ / /   \ \ | | 
| |   | | |_| |  __/ | | | |_  | |_/ / | |_   \ V /.___/ /_| |_
\_|   |_|\__,_|\___|_| |_|\__| \____/|_|\__|   \_/ \____(_)___/

[2024/09/27 17:48:25] [ info] [fluent bit] version=3.2.0, commit=ff8803f050, pid=94228
[2024/09/27 17:48:25] [ info] [storage] ver=1.1.6, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2024/09/27 17:48:25] [ info] [cmetrics] version=0.9.6
[2024/09/27 17:48:25] [ info] [ctraces ] version=0.5.6
[2024/09/27 17:48:25] [ info] [input:opentelemetry:opentelemetry.0] initializing
[2024/09/27 17:48:25] [ info] [input:opentelemetry:opentelemetry.0] storage_strategy='memory' (memory only)
[2024/09/27 17:48:25] [ info] [input:opentelemetry:opentelemetry.0] listening on 0.0.0.0:4310
[2024/09/27 17:48:25] [ info] [output:stdout:stdout.0] worker #0 started
[2024/09/27 17:48:25] [ info] [sp] stream processor started
[2024/09/27 17:48:31] [trace] [input:opentelemetry:opentelemetry.0 at /Users/lecaros/workspaces/fluent/fluent-bit/plugins/in_opentelemetry/opentelemetry.c:53] new TCP connection arrived FD=40
[2024/09/27 17:48:31] [trace] [input:opentelemetry:opentelemetry.0 at /Users/lecaros/workspaces/fluent/fluent-bit/plugins/in_opentelemetry/http_conn.c:90] read()=182 pre_len=0 now_len=182
[0] v1_logs: [[-1.000000000, {"schema"=>"otlp", "resource_id"=>0, "scope_id"=>0}], {"resource"=>{}, "schema_url"=>"", "scope"=>{}}]
[1] v1_logs: [[1727470110.1420677698, {"otlp"=>{"observed_timestamp"=>0, "timestamp"=>1727470110553468000, "trace_flags"=>0}}], {"message"=>"dummy"}]
[2] v1_logs: [[-2.000000000, {}], {}]
[2024/09/27 17:48:32] [trace] [input:opentelemetry:opentelemetry.0 at /Users/lecaros/workspaces/fluent/fluent-bit/plugins/in_opentelemetry/http_conn.c:84] fd=40 closed connection

Your Environment

  • Version used: 3.2.0 unstable from master branch.
  • Configuration: provided above
  • Filters and plugins: otel opentelemetry

Additional context

There's a workaround, which is to disable the http2.

The relevant code to generate the tag is only implemented when the call is not 'http2'.

@lecaros
Copy link
Contributor Author

lecaros commented Sep 27, 2024

We already have a PR (#8963) on the queue for this.

@lecaros
Copy link
Contributor Author

lecaros commented Oct 1, 2024

Fixed in #8963 and backported to 3.1 in #9447

@lecaros lecaros closed this as completed Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant