Skip to content

Commit 4d76990

Browse files
authored
Merge branch 'main' into fixex_3271
2 parents 046c091 + b89e63c commit 4d76990

File tree

6 files changed

+41
-5
lines changed

6 files changed

+41
-5
lines changed

.github/workflows/fossa.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: FOSSA scanning
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
fossa:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
17+
- uses: fossas/fossa-action@93a52ecf7c3ac7eb40f5de77fd69b1a19524de94 # v1.5.0
18+
with:
19+
api-key: ${{secrets.FOSSA_API_KEY}}
20+
team: OpenTelemetry

exporters/etw/include/opentelemetry/exporters/etw/TraceLoggingDynamic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2141,7 +2141,7 @@ namespace tld
21412141

21422142
void AddFieldInfo(UINT8 arity, Type type, UINT32 tags)
21432143
{
2144-
_tld_ASSERT((type & InTypeMask) == (type & 0xff), "InType out of range");
2144+
_tld_ASSERT((type & (Type)InTypeMask) == (type & 0xff), "InType out of range");
21452145
_tld_ASSERT((type & _tld_MAKE_TYPE(0, OutTypeMask)) == (Type)(type & 0xffffff00), "OutType out of range");
21462146

21472147
UINT8 inMeta = arity | static_cast<UINT8>(type);

exporters/otlp/include/opentelemetry/exporters/otlp/otlp_log_recordable.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,7 @@ class OtlpLogRecordable final : public opentelemetry::sdk::logs::Recordable
7676
* @param id the event Id to set
7777
* @param name the event name to set
7878
*/
79-
void SetEventId(int64_t /* id */, nostd::string_view /* name */) noexcept override
80-
{
81-
// TODO: export Event Id to OTLP
82-
}
79+
void SetEventId(int64_t /* id */, nostd::string_view event_name) noexcept override;
8380

8481
/**
8582
* Set the trace id for this log.

exporters/otlp/src/otlp_log_recordable.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ void OtlpLogRecordable::SetBody(const opentelemetry::common::AttributeValue &mes
197197
OtlpPopulateAttributeUtils::PopulateAnyValue(proto_record_.mutable_body(), message);
198198
}
199199

200+
void OtlpLogRecordable::SetEventId(int64_t /* id */, nostd::string_view event_name) noexcept
201+
{
202+
proto_record_.set_event_name(event_name.data(), event_name.size());
203+
}
204+
200205
void OtlpLogRecordable::SetTraceId(const opentelemetry::trace::TraceId &trace_id) noexcept
201206
{
202207
if (trace_id.IsValid())

exporters/otlp/test/otlp_log_recordable_test.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,16 @@ TEST(OtlpLogRecordable, SetInstrumentationScope)
174174
EXPECT_EQ(&rec.GetInstrumentationScope(), inst_lib.get());
175175
}
176176

177+
TEST(OtlpLogRecordable, SetEventName)
178+
{
179+
OtlpLogRecordable rec;
180+
181+
nostd::string_view event_name = "Test Event";
182+
rec.SetEventId(0, event_name);
183+
184+
EXPECT_EQ(rec.log_record().event_name(), event_name);
185+
}
186+
177187
/**
178188
* AttributeValue can contain different int types, such as int, int64_t,
179189
* unsigned int, and uint64_t. To avoid writing test cases for each, we can

sdk/src/metrics/instrument_metadata_validator.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,22 @@
99

1010
#if OPENTELEMETRY_HAVE_WORKING_REGEX
1111
# include <regex>
12+
#else
13+
# include <algorithm>
1214
#endif
1315

1416
OPENTELEMETRY_BEGIN_NAMESPACE
1517
namespace sdk
1618
{
1719
namespace metrics
1820
{
21+
#if OPENTELEMETRY_HAVE_WORKING_REGEX
1922
// instrument-name = ALPHA 0*254 ("_" / "." / "-" / "/" / ALPHA / DIGIT)
2023
const std::string kInstrumentNamePattern = "[a-zA-Z][-_./a-zA-Z0-9]{0,254}";
2124
//
2225
const std::string kInstrumentUnitPattern = "[\x01-\x7F]{0,63}";
2326
// instrument-unit = It can have a maximum length of 63 ASCII chars
27+
#endif
2428

2529
InstrumentMetaDataValidator::InstrumentMetaDataValidator()
2630
#if OPENTELEMETRY_HAVE_WORKING_REGEX

0 commit comments

Comments
 (0)