Module: Datadog::Core::Environment::Process Private
- Defined in:
- lib/datadog/core/environment/process.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Retrieves process level information such that it can be attached to various payloads
Class Method Summary collapse
-
.rails_application_name=(name) ⇒ void
private
Sets the rails application name from other places in code.
-
.serialized ⇒ String
private
Returns a comma-separated string of normalized key:value pairs.
-
.set_service(name, user_configured:) ⇒ void
private
Called via after_set on option :service in settings.rb whenever the service value changes.
-
.tags ⇒ Array<String>
private
Returns an array of normalized key:value pair strings.
Class Method Details
.rails_application_name=(name) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Sets the rails application name from other places in code
66 67 68 |
# File 'lib/datadog/core/environment/process.rb', line 66 def self.rails_application_name=(name) @rails_application_name = name end |
.serialized ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a comma-separated string of normalized key:value pairs. Includes svc.user or svc.auto based on whether the service was explicitly configured.
16 17 18 |
# File 'lib/datadog/core/environment/process.rb', line 16 def self.serialized .join(",").freeze end |
.set_service(name, user_configured:) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Called via after_set on option :service in settings.rb whenever the service value changes.
58 59 60 61 |
# File 'lib/datadog/core/environment/process.rb', line 58 def self.set_service(name, user_configured:) @service_name = name @service_user_configured = user_configured end |
.tags ⇒ Array<String>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns an array of normalized key:value pair strings. Includes svc.user or svc.auto based on whether the service was explicitly configured.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/datadog/core/environment/process.rb', line 23 def self. = [] workdir = TagNormalizer.normalize_process_value(entrypoint_workdir.to_s) << "#{Environment::Ext::TAG_ENTRYPOINT_WORKDIR}:#{workdir}" unless workdir.empty? entry_name = TagNormalizer.normalize_process_value(entrypoint_name.to_s) << "#{Environment::Ext::TAG_ENTRYPOINT_NAME}:#{entry_name}" unless entry_name.empty? basedir = TagNormalizer.normalize_process_value(entrypoint_basedir.to_s) << "#{Environment::Ext::TAG_ENTRYPOINT_BASEDIR}:#{basedir}" unless basedir.empty? << "#{Environment::Ext::TAG_ENTRYPOINT_TYPE}:#{TagNormalizer.normalize(entrypoint_type, remove_digit_start_char: false)}" if defined?(@rails_application_name) rails_name = TagNormalizer.normalize_process_value(@rails_application_name.to_s) << "#{Environment::Ext::TAG_RAILS_APPLICATION}:#{rails_name}" unless rails_name.empty? end if defined?(@service_user_configured) if @service_user_configured << "#{Environment::Ext::TAG_SVC_USER}:true" else svc = TagNormalizer.normalize_process_value(@service_name.to_s) << "#{Environment::Ext::TAG_SVC_AUTO}:#{svc}" unless svc.empty? end end .freeze end |