Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions sdk/src/metrics/instrument_metadata_validator.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#if OPENTELEMETRY_HAVE_WORKING_REGEX
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI is failing for this - you need to include instrument_metadata_validator.h before using this macro. The changes look good otherwise.

#include <algorithm>
#endif
#include <string>

#include "opentelemetry/nostd/string_view.h"
Expand All @@ -16,11 +19,13 @@ namespace sdk
{
namespace metrics
{
#if OPENTELEMETRY_HAVE_WORKING_REGEX
// instrument-name = ALPHA 0*254 ("_" / "." / "-" / "/" / ALPHA / DIGIT)
const std::string kInstrumentNamePattern = "[a-zA-Z][-_./a-zA-Z0-9]{0,254}";
//
const std::string kInstrumentUnitPattern = "[\x01-\x7F]{0,63}";
// instrument-unit = It can have a maximum length of 63 ASCII chars
#endif

InstrumentMetaDataValidator::InstrumentMetaDataValidator()
#if OPENTELEMETRY_HAVE_WORKING_REGEX
Expand Down
Loading