-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into issues-1707
- Loading branch information
Showing
35 changed files
with
350 additions
and
35 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'bundler/inline' | ||
|
||
gemfile(true) do | ||
source 'https://rubygems.org' | ||
|
||
gem 'opentelemetry-logs-api', path: '../../logs_api' | ||
gem 'opentelemetry-logs-sdk', path: '../../logs_sdk' | ||
end | ||
|
||
require 'opentelemetry-logs-sdk' | ||
|
||
# Create a LoggerProvider | ||
logger_provider = OpenTelemetry::SDK::Logs::LoggerProvider.new | ||
# Create a batching processor configured to export to the OTLP exporter | ||
processor = OpenTelemetry::SDK::Logs::Export::SimpleLogRecordProcessor.new(OpenTelemetry::SDK::Logs::Export::ConsoleLogRecordExporter.new) | ||
# Add the processor to the LoggerProvider | ||
logger_provider.add_log_record_processor(processor) | ||
# Access a Logger for your library from your LoggerProvider | ||
logger = logger_provider.logger(name: 'my_app_or_gem', version: '0.1.0') | ||
|
||
# Use your Logger to emit a log record | ||
logger.on_emit( | ||
timestamp: Time.now, | ||
severity_text: 'INFO', | ||
body: 'Thuja plicata', | ||
attributes: { 'cedar' => true }, | ||
) | ||
|
||
logger_provider.shutdown |
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,31 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'bundler/inline' | ||
|
||
gemfile(true) do | ||
source 'https://rubygems.org' | ||
|
||
gem 'opentelemetry-sdk', path: '../../sdk' | ||
gem 'opentelemetry-logs-api', path: '../../logs_api' | ||
gem 'opentelemetry-logs-sdk', path: '../../logs_sdk' | ||
end | ||
|
||
require 'opentelemetry-sdk' | ||
require 'opentelemetry-logs-sdk' | ||
|
||
# Export logs to the console | ||
ENV['OTEL_LOGS_EXPORTER'] = 'console' | ||
|
||
# Configure SDK with defaults, this will apply the OTEL_LOGS_EXPORTER env var | ||
OpenTelemetry::SDK.configure | ||
|
||
# Access a Logger for your library from the LoggerProvider configured by the OpenTelemetry API | ||
logger = OpenTelemetry.logger_provider.logger(name: 'my_app_or_gem', version: '0.1.0') | ||
|
||
# Use your Logger to emit a log record | ||
logger.on_emit( | ||
timestamp: Time.now, | ||
severity_text: 'INFO', | ||
body: 'Thuja plicata', | ||
attributes: { 'cedar' => true }, | ||
) |
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,33 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'bundler/inline' | ||
|
||
gemfile(true) do | ||
source 'https://rubygems.org' | ||
|
||
gem 'opentelemetry-logs-api', path: '../../logs_api' | ||
gem 'opentelemetry-logs-sdk', path: '../../logs_sdk' | ||
gem 'opentelemetry-exporter-otlp-logs', path: '../../exporter/otlp-logs' | ||
end | ||
|
||
require 'opentelemetry-logs-sdk' | ||
require 'opentelemetry/exporter/otlp_logs' | ||
|
||
# Create a LoggerProvider | ||
logger_provider = OpenTelemetry::SDK::Logs::LoggerProvider.new | ||
# Create a batching processor configured to export to the OTLP exporter | ||
processor = OpenTelemetry::SDK::Logs::Export::BatchLogRecordProcessor.new(OpenTelemetry::Exporter::OTLP::Logs::LogsExporter.new) | ||
# Add the processor to the LoggerProvider | ||
logger_provider.add_log_record_processor(processor) | ||
# Access a Logger for your library from your LoggerProvider | ||
logger = logger_provider.logger(name: 'my_app_or_gem', version: '0.1.0') | ||
|
||
# Use your Logger to emit a log record | ||
logger.on_emit( | ||
timestamp: Time.now, | ||
severity_text: 'INFO', | ||
body: 'Thuja plicata', | ||
attributes: { 'cedar' => true }, | ||
) | ||
|
||
logger_provider.shutdown |
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
# Release History: opentelemetry-exporter-otlp-logs | ||
|
||
### v0.1.0 / 2024-12-04 | ||
|
||
Initial release. |
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
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
# Release History: opentelemetry-logs-api | ||
|
||
### v0.1.0 / 2024-12-04 | ||
|
||
Initial release. |
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
# Release History: opentelemetry-logs-sdk | ||
|
||
### v0.1.0 / 2024-12-04 | ||
|
||
Initial release. |
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,23 @@ | ||
# frozen_string_literal: true | ||
|
||
# Copyright The OpenTelemetry Authors | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
module OpenTelemetry | ||
module Metrics | ||
module Instrument | ||
# No-op implementation of Gauge. | ||
class Gauge | ||
# Record the current value for the Gauge | ||
# | ||
# @param [Numeric] amount The current absolute value. | ||
# @param [Hash{String => String, Numeric, Boolean, Array<String, Numeric, Boolean>}] attributes | ||
# Values must be non-nil and (array of) string, boolean or numeric type. | ||
# Array values must not contain nil elements and all elements must be of | ||
# the same basic type (string, numeric, boolean). | ||
def record(amount, attributes: {}); end | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.