Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nexus_semantic_logger
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Public
nexus_semantic_logger
Commits
3d5e199d
Commit
3d5e199d
authored
2 years ago
by
John Harris
Browse files
Options
Downloads
Patches
Plain Diff
feat: remove env tagging, leave to the agent defaults
parent
d2941bb2
No related branches found
Branches containing commit
Tags
1.7.3
Tags containing commit
No related merge requests found
Pipeline
#34906
passed
2 years ago
Stage: release
Stage: test
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/nexus_semantic_logger/datadog_formatter.rb
+1
-1
1 addition, 1 deletion
lib/nexus_semantic_logger/datadog_formatter.rb
lib/nexus_semantic_logger/datadog_tracer.rb
+8
-2
8 additions, 2 deletions
lib/nexus_semantic_logger/datadog_tracer.rb
with
9 additions
and
3 deletions
lib/nexus_semantic_logger/datadog_formatter.rb
+
1
−
1
View file @
3d5e199d
...
...
@@ -22,7 +22,7 @@ module NexusSemanticLogger
hash
[
:source
]
=
:rails
level
=
hash
.
delete
(
:level
)
hash
[
:status
]
=
level
hash
[
:env
]
=
Rails
.
env
hash
[
:
rails
env
]
=
Rails
.
env
hash
[
:service
]
=
@service
hash
.
delete
(
:application
)
hash
.
delete
(
:environment
)
...
...
This diff is collapsed.
Click to expand it.
lib/nexus_semantic_logger/datadog_tracer.rb
+
8
−
2
View file @
3d5e199d
...
...
@@ -15,13 +15,19 @@ module NexusSemanticLogger
# By default, runtime metrics from the application are sent to the Datadog Agent with DogStatsD on port 8125.
datadog_singleton
=
DatadogSingleton
.
instance
datadog_singleton
.
statsd
=
Datadog
::
Statsd
.
new
(
ENV
[
'DD_AGENT_HOST'
],
8125
)
datadog_singleton
.
tags
=
[
"env:
#{
Rails
.
env
}
"
,
"service:
#{
service
}
"
]
c
.
runtime_metrics
.
statsd
=
datadog_singleton
.
statsd
# Configure tags to be sent on all traces and metrics.
# Note that 'env' is NOT sent- that is set as the default on the agent e.g. staging, canary, production.
# It does not necessarily align with the Rails env, and we do not want to double tag the env.
datadog_singleton
.
tags
=
[
"railsenv:
#{
Rails
.
env
}
"
,
"service:
#{
service
}
"
]
c
.
tags
=
datadog_singleton
.
tags
# Tracer requires configuration to a datadog agent via DD_AGENT_HOST.
dd_force_tracer_val
=
ENV
.
fetch
(
'DD_FORCE_TRACER'
,
false
)
dd_force_tracer
=
dd_force_tracer_val
.
present?
&&
dd_force_tracer_val
.
to_s
==
'true'
c
.
tracer
(
enabled:
Rails
.
env
.
production?
||
dd_force_tracer
,
env:
Rails
.
env
)
puts
"** dd_force_tracer:
#{
dd_force_tracer
}
"
c
.
tracer
(
enabled:
Rails
.
env
.
production?
||
dd_force_tracer
)
end
c
.
use
(
:rails
,
service_name:
service
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment