Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
Signed-off-by: owentou <[email protected]>
  • Loading branch information
owent committed Jul 27, 2022
1 parent 30dc788 commit 6d2bacc
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion docs/cpp-metrics-api-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ implementation of the `MeterProvider` into the API
**`GetMeter(name, version)` method must be supported**

* Expects 2 string arguments:
* name (required): identifies the instrumentation library.
* name (required): identifies the instrumentation scope.
* version (optional): specifies the version of the instrumenting library (the
library injecting OpenTelemetry calls into the code)

Expand Down
4 changes: 2 additions & 2 deletions docs/cpp-metrics-sdk-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ implementation of the `MeterProvider` into the API.
**`GetMeter(name, version)` method must be supported**

* Expects 2 string arguments:
* name (required): identifies the instrumentation library.
* name (required): identifies the instrumentation scope.
* version (optional): specifies the version of the instrumenting library (the
library injecting OpenTelemetry calls into the code).

Expand Down Expand Up @@ -142,7 +142,7 @@ public:
*
* Arguments:
* MeterProvider, the MeterProvider object that spawned this Meter.
* InstrumentationInfo, the name of the instrumentation library and, optionally,
* InstrumentationInfo, the name of the instrumentation scope and, optionally,
* the version.
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ class ElasticSearchRecordable final : public sdk::logs::Recordable

/**
* Set instrumentation_scope for this log.
* @param instrumentation_scopehe instrumentation library to set
* @param instrumentation_scope the instrumentation scope to set
*/
void SetInstrumentationScope(const opentelemetry::sdk::instrumentationscope::InstrumentationScope
&instrumentation_scope) noexcept
&instrumentation_scope) noexcept override
{
json_["name"] = instrumentation_scope.GetName();
instrumentation_scope_ = &instrumentation_scope;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class OtlpLogRecordable final : public opentelemetry::sdk::logs::Recordable

/**
* Set instrumentation_scope for this log.
* @param instrumentation_scopehe instrumentation library to set
* @param instrumentation_scope the instrumentation scope to set
*/
void SetInstrumentationScope(const opentelemetry::sdk::instrumentationscope::InstrumentationScope
&instrumentation_scope) noexcept override;
Expand All @@ -105,7 +105,7 @@ class OtlpLogRecordable final : public opentelemetry::sdk::logs::Recordable
return GetInstrumentationScope();
}

/** Returns the associated instruementation library */
/** Returns the associated instruementation scope */
const opentelemetry::sdk::instrumentationscope::InstrumentationScope &GetInstrumentationScope()
const noexcept;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class OtlpMetricUtils
static void ConvertGaugeMetric(const opentelemetry::sdk::metrics::MetricData &metric_data,
proto::metrics::v1::Gauge *const gauge) noexcept;

static void PopulateInstrumentationInfoMetric(
static void PopulateInstrumentInfoMetrics(
const opentelemetry::sdk::metrics::MetricData &metric_data,
proto::metrics::v1::Metric *metric) noexcept;

Expand Down
4 changes: 2 additions & 2 deletions exporters/otlp/src/otlp_metric_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ void OtlpMetricUtils::ConvertGaugeMetric(const opentelemetry::sdk::metrics::Metr
}
}

void OtlpMetricUtils::PopulateInstrumentationInfoMetric(
void OtlpMetricUtils::PopulateInstrumentInfoMetrics(
const opentelemetry::sdk::metrics::MetricData &metric_data,
proto::metrics::v1::Metric *metric) noexcept
{
Expand Down Expand Up @@ -214,7 +214,7 @@ void OtlpMetricUtils::PopulateResourceMetrics(

for (auto &metric_data : scope_metrics.metric_data_)
{
PopulateInstrumentationInfoMetric(metric_data, scope_lib_metrics->add_metrics());
PopulateInstrumentInfoMetrics(metric_data, scope_lib_metrics->add_metrics());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class InstrumentationScope

/**
* Returns a newly created InstrumentationScope with the specified library name and version.
* @param name name of the instrumentation library.
* @param version version of the instrumentation library.
* @param name name of the instrumentation scope.
* @param version version of the instrumentation scope.
* @param schema_url schema url of the telemetry emitted by the library.
* @returns the newly created InstrumentationScope.
*/
Expand All @@ -41,7 +41,7 @@ class InstrumentationScope

/**
* Compare 2 instrumentation libraries.
* @param other the instrumentation library to compare to.
* @param other the instrumentation scope to compare to.
* @returns true if the 2 instrumentation libraries are equal, false otherwise.
*/
bool operator==(const InstrumentationScope &other) const
Expand All @@ -50,12 +50,12 @@ class InstrumentationScope
}

/**
* Check whether the instrumentation library has given name and version.
* Check whether the instrumentation scope has given name and version.
* This could be used to check version equality and avoid heap allocation.
* @param name name of the instrumentation library to compare.
* @param version version of the instrumentatoin library to compare.
* @param schema_url schema url of the telemetry emitted by the library.
* @returns true if name and version in this instrumentation library are equal with the given name
* @param name name of the instrumentation scope to compare.
* @param version version of the instrumentation scope to compare.
* @param schema_url schema url of the telemetry emitted by the scope.
* @returns true if name and version in this instrumentation scope are equal with the given name
* and version.
*/
bool equal(const nostd::string_view name,
Expand Down
2 changes: 1 addition & 1 deletion sdk/include/opentelemetry/sdk/logs/log_record.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class LogRecord final : public Recordable

/**
* Set instrumentation_scope for this log.
* @param instrumentation_scopehe instrumentation library to set
* @param instrumentation_scope the instrumentation scope to set
*/
void SetInstrumentationScope(const opentelemetry::sdk::instrumentationscope::InstrumentationScope
&instrumentation_scope) noexcept
Expand Down
4 changes: 2 additions & 2 deletions sdk/include/opentelemetry/sdk/logs/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Logger final : public opentelemetry::logs::Logger
opentelemetry::trace::TraceFlags trace_flags,
opentelemetry::common::SystemTimestamp timestamp) noexcept override;

/** Returns the associated instruementation library */
/** Returns the associated instrumentation scope */
const opentelemetry::sdk::instrumentationscope::InstrumentationScope &GetInstrumentationScope()
const noexcept;

Expand All @@ -73,7 +73,7 @@ class Logger final : public opentelemetry::logs::Logger
// The name of this logger
std::string logger_name_;

// order of declaration is important here - instrumentation library should destroy after
// order of declaration is important here - instrumentation scope should destroy after
// logger-context.
std::unique_ptr<instrumentationscope::InstrumentationScope> instrumentation_scope_;
std::shared_ptr<LoggerContext> context_;
Expand Down
4 changes: 2 additions & 2 deletions sdk/include/opentelemetry/sdk/logs/multi_recordable.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ class MultiRecordable final : public Recordable

/**
* Set instrumentation_scope for this log.
* @param instrumentation_scopehe instrumentation library to set
* @param instrumentation_scope the instrumentation scope to set
*/
void SetInstrumentationScope(const opentelemetry::sdk::instrumentationscope::InstrumentationScope
&instrumentation_scope) noexcept override;

/** Returns the associated instruementation library */
/** Returns the associated instrumentation scope */
const opentelemetry::sdk::instrumentationscope::InstrumentationScope &GetInstrumentationScope()
const noexcept;

Expand Down
2 changes: 1 addition & 1 deletion sdk/include/opentelemetry/sdk/logs/recordable.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class Recordable

/**
* Set instrumentation_scope for this log.
* @param instrumentation_scopehe instrumentation library to set
* @param instrumentation_scope the instrumentation scope to set
*/
virtual void SetInstrumentationScope(
const opentelemetry::sdk::instrumentationscope::InstrumentationScope
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace metrics

/**
* Metric Data to be exported along with resources and
* Instrumentation library.
* Instrumentation scope.
*/
struct ScopeMetrics
{
Expand Down
4 changes: 2 additions & 2 deletions sdk/include/opentelemetry/sdk/metrics/meter.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class Meter final : public opentelemetry::metrics::Meter
nostd::string_view unit = "",
void *state = nullptr) noexcept override;

/** Returns the associated instruementation library */
/** Returns the associated instrumentation scope */
const sdk::instrumentationscope::InstrumentationScope *GetInstrumentationScope() const noexcept;

OPENTELEMETRY_DEPRECATED_MESSAGE("Please use GetInstrumentationScope instead")
Expand All @@ -119,7 +119,7 @@ class Meter final : public opentelemetry::metrics::Meter
opentelemetry::common::SystemTimestamp collect_ts) noexcept;

private:
// order of declaration is important here - instrumentation library should destroy after
// order of declaration is important here - instrumentation scope should destroy after
// meter-context.
std::unique_ptr<sdk::instrumentationscope::InstrumentationScope> scope_;
std::shared_ptr<sdk::metrics::MeterContext> meter_context_;
Expand Down
4 changes: 2 additions & 2 deletions sdk/include/opentelemetry/sdk/trace/recordable.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ class Recordable
virtual void SetDuration(std::chrono::nanoseconds duration) noexcept = 0;

/**
* Set the instrumentation library of the span.
* @param instrumentation_scope the instrumentation library to set
* Set the instrumentation scope of the span.
* @param instrumentation_scope the instrumentation scope to set
*/
virtual void SetInstrumentationScope(
const InstrumentationScope &instrumentation_scope) noexcept = 0;
Expand Down
2 changes: 1 addition & 1 deletion sdk/include/opentelemetry/sdk/trace/span_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class SpanData final : public Recordable
{
if (instrumentation_scope_ == nullptr)
{
// this shouldn't happen as Tracer ensures there is valid default instrumentation library.
// this shouldn't happen as Tracer ensures there is valid default instrumentation scope.
static std::unique_ptr<opentelemetry::sdk::instrumentationscope::InstrumentationScope>
instrumentation_scope =
opentelemetry::sdk::instrumentationscope::InstrumentationScope::Create(
Expand Down
4 changes: 2 additions & 2 deletions sdk/include/opentelemetry/sdk/trace/tracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Tracer final : public trace_api::Tracer, public std::enable_shared_from_th
/** Returns the configured Id generator */
IdGenerator &GetIdGenerator() const noexcept { return context_->GetIdGenerator(); }

/** Returns the associated instruementation library */
/** Returns the associated instrumentation scope */
const InstrumentationScope &GetInstrumentationScope() const noexcept
{
return *instrumentation_scope_;
Expand All @@ -67,7 +67,7 @@ class Tracer final : public trace_api::Tracer, public std::enable_shared_from_th
Sampler &GetSampler() { return context_->GetSampler(); }

private:
// order of declaration is important here - instrumentation library should destroy after
// order of declaration is important here - instrumentation scope should destroy after
// tracer-context.
std::shared_ptr<InstrumentationScope> instrumentation_scope_;
std::shared_ptr<sdk::trace::TracerContext> context_;
Expand Down

0 comments on commit 6d2bacc

Please sign in to comment.