-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #123 from solarwinds/NH-76676
NH-76676: using noop for all possible error from our agent
- Loading branch information
Showing
18 changed files
with
174 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# © 2023 SolarWinds Worldwide, LLC. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at:http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. | ||
|
||
#### | ||
# noop version of SolarWindsAPM::API | ||
# | ||
module SolarWindsAPM | ||
# API | ||
module API | ||
end | ||
end | ||
|
||
module NoopAPI | ||
# Tracing | ||
module Tracing | ||
# (wait_milliseconds=3000, integer_response: false) | ||
def solarwinds_ready?(*_args, **options) | ||
options && options[:integer_response] ? 0 : false | ||
end | ||
end | ||
|
||
# CurrentTraceInfo | ||
module CurrentTraceInfo | ||
def current_trace_info | ||
TraceInfo.new | ||
end | ||
|
||
class TraceInfo | ||
attr_reader :tracestring, :trace_id, :span_id, :trace_flags, :do_log | ||
|
||
def initialize | ||
@trace_id = '00000000000000000000000000000000' | ||
@span_id = '0000000000000000' | ||
@trace_flags = '00' | ||
@tracestring = '00-00000000000000000000000000000000-0000000000000000-00' | ||
@service_name = '' | ||
@do_log = :never | ||
end | ||
|
||
def for_log | ||
'' | ||
end | ||
|
||
def hash_for_log | ||
{} | ||
end | ||
end | ||
end | ||
|
||
# CustomMetrics | ||
module CustomMetrics | ||
def increment_metric(*) | ||
false | ||
end | ||
|
||
def summary_metric(*) | ||
false | ||
end | ||
end | ||
|
||
# OpenTelemetry | ||
module OpenTelemetry | ||
def in_span(*) | ||
yield if block_given? | ||
end | ||
end | ||
|
||
# TransactionName | ||
module TransactionName | ||
def set_transaction_name(*) | ||
true | ||
end | ||
end | ||
end | ||
|
||
SolarWindsAPM::API.extend(NoopAPI::Tracing) | ||
SolarWindsAPM::API.extend(NoopAPI::CurrentTraceInfo) | ||
SolarWindsAPM::API.extend(NoopAPI::CustomMetrics) | ||
SolarWindsAPM::API.extend(NoopAPI::OpenTelemetry) | ||
SolarWindsAPM::API.extend(NoopAPI::TransactionName) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters