Class: NewRelic::Agent::OpenTelemetry::HttpServerTranslator
- Inherits:
-
BaseTranslator
- Object
- BaseTranslator
- NewRelic::Agent::OpenTelemetry::HttpServerTranslator
show all
- Defined in:
- lib/new_relic/agent/opentelemetry/translators/http_server_translator.rb
Constant Summary
AttributeMappings::DATASTORE_MAPPINGS, AttributeMappings::DEFAULT_DESTINATIONS, AttributeMappings::HTTP_CLIENT_MAPPINGS, AttributeMappings::HTTP_SERVER_MAPPINGS
Class Method Summary
collapse
translate
Class Method Details
.add_specialized_attributes(result: {}, name: nil, attributes: nil, instrumentation_scope: nil) ⇒ Object
16
17
18
19
20
|
# File 'lib/new_relic/agent/opentelemetry/translators/http_server_translator.rb', line 16
def add_specialized_attributes(result: {}, name: nil, attributes: nil, instrumentation_scope: nil)
result[:for_segment_api][:name] = create_server_transaction_name(name, instrumentation_scope, attributes)
result
end
|
.create_server_transaction_name(original_name, instrumentation_scope, attributes) ⇒ Object
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/new_relic/agent/opentelemetry/translators/http_server_translator.rb', line 22
def create_server_transaction_name(original_name, instrumentation_scope, attributes)
attributes ||= NewRelic::EMPTY_HASH
method = attributes['http.request.method'] || attributes['http.method']
path = attributes['url.path'] || attributes['http.target']
if method && path
Instrumentation::ControllerInstrumentation::TransactionNamer.name_for(nil, nil, :web, {class_name: instrumentation_scope, name: "#{method} #{path}"})
else
original_name
end
end
|