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

PG name incorrect when prefixing annotations #452

Closed
KaoruDev opened this issue May 3, 2023 · 1 comment · Fixed by #690
Closed

PG name incorrect when prefixing annotations #452

KaoruDev opened this issue May 3, 2023 · 1 comment · Fixed by #690
Labels
bug Something isn't working stale Marks an issue/PR stale

Comments

@KaoruDev
Copy link

KaoruDev commented May 3, 2023

Description of the bug

When using https://github.com/basecamp/marginalia gem to prefix SQL queries with annotations, the Span name no longer contains the operation. For example, prior to prefixing I would see SELECT my_db now I just see my_db and the operation attribute is missing.

I suspect it's because the extract_operation method does not take comments into consideration.

Share details about your runtime

Operating system details: Linux, Debian 11 LTS
RUBY_ENGINE: "ruby"
RUBY_VERSION: "3.1.3"
RUBY_DESCRIPTION: "ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [aarch64-linux]"

Share a simplified reproduction if possible

require 'bundler/inline'

gemfile(true) do
  source 'https://rubygems.org'

  gem 'opentelemetry-api'
  gem 'opentelemetry-sdk'
  # gem 'opentelemetry-exporter-jaeger'
  # gem 'opentelemetry-exporter-otlp'
  # gem 'opentelemetry-exporter-zipkin'
end

require 'opentelemetry-api'
require 'opentelemetry-sdk'

span_processor = OpenTelemetry::SDK::Trace::Export::SimpleSpanProcessor.new(
  OpenTelemetry::SDK::Trace::Export::ConsoleSpanExporter.new
)

# require 'opentelemetry/exporter/jaeger'
# exporter = OpenTelemetry::Exporter::Jaeger::AgentExporter.new(max_packet_size: 9 * 1024)
# span_processor = OpenTelemetry::SDK::Trace::Export::BatchSpanProcessor.new(exporter)

# require 'opentelemetry/shopify/exporters/otlp'
# exporter = OpenTelemetry::Exporter::OTLP::Exporter.new
# span_processor = OpenTelemetry::SDK::Trace::Export::BatchSpanProcessor.new(exporter)

# require 'opentelemetry/shopify/exporters/otlp'
# exporter = OpenTelemetry::Exporter::OTLP::Exporter.new
# span_processor = OpenTelemetry::SDK::Trace::Export::BatchSpanProcessor.new(exporter)

OpenTelemetry::SDK.configure do |c|
  c.add_span_processor(span_processor)
end

SimpleTracer = OpenTelemetry.tracer_provider.tracer('Bug Report')

class User < ActiveRecord::Base
end

SimpleTracer.in_span('Parent span') do
  User.first
end

OpenTelemetry.tracer_provider.shutdown
@KaoruDev KaoruDev added the bug Something isn't working label May 3, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 3, 2023

👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this issue will be closed eventually by the stale bot.

@github-actions github-actions bot added the stale Marks an issue/PR stale label Jun 3, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale Marks an issue/PR stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant