Skip to content

Commit

Permalink
Merge branch 'open-telemetry:main' into fix-elastic-search-exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowMaxLeb authored Oct 8, 2024
2 parents b1cf143 + fa0a520 commit d010ced
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 16 deletions.
89 changes: 89 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,104 @@ Increment the:

## [Unreleased]

## [1.17 2024-10-07]

* [CI] Add a clang-tidy build
[#3001](https://github.com/open-telemetry/opentelemetry-cpp/pull/3001)

* [BUILD] Upgrade to opentelemetry-proto 1.3.2
[#2991](https://github.com/open-telemetry/opentelemetry-cpp/pull/2991)

* [REMOVAL] Remove build option `WITH_DEPRECATED_SDK_FACTORY`
[#2717](https://github.com/open-telemetry/opentelemetry-cpp/pull/2717)

* [EXPORTER] ForceFlush before canceling the running requests on shutdown
[#2727](https://github.com/open-telemetry/opentelemetry-cpp/pull/2727)

* [SDK] Fix crash in PeriodicExportingMetricReader
[#2983](https://github.com/open-telemetry/opentelemetry-cpp/pull/2983)

* [SDK] Fix memory leak in TlsRandomNumberGenerator() constructor
[#2661](https://github.com/open-telemetry/opentelemetry-cpp/pull/2661)

* [EXPORTER] Ignore exception when create thread in OTLP file exporter
[#3012](https://github.com/open-telemetry/opentelemetry-cpp/pull/3012)

* [BUILD] Update the version in MODULE.bazel
[#3015](https://github.com/open-telemetry/opentelemetry-cpp/pull/3015)

* [BUILD] Fix build without vcpkg on Windows when gRPC is disabled
[#3016](https://github.com/open-telemetry/opentelemetry-cpp/pull/3016)

* [BUILD] Add abi_version_no bazel flag
[#3020](https://github.com/open-telemetry/opentelemetry-cpp/pull/3020)

* [Code health] Expand iwyu coverage to include unit tests
[#3022](https://github.com/open-telemetry/opentelemetry-cpp/pull/3022)

* [BUILD] Version opentelemetry_proto/proto_grpc shared libraries
[#2992](https://github.com/open-telemetry/opentelemetry-cpp/pull/2992)

* [SEMANTIC CONVENTIONS] Upgrade semantic conventions to 1.27.0
[#3023](https://github.com/open-telemetry/opentelemetry-cpp/pull/3023)

* [SDK] Support empty histogram buckets
[#3027](https://github.com/open-telemetry/opentelemetry-cpp/pull/3027)

* [TEST] Fix sync problems in OTLP File exporter tests
[#3031](https://github.com/open-telemetry/opentelemetry-cpp/pull/3031)

* [SDK] PeriodicExportingMetricReader: future is never set, blocks until timeout
[#3030](https://github.com/open-telemetry/opentelemetry-cpp/pull/3030)

* [Code Health] Clang Tidy cleanup, Part 2
[#3038](https://github.com/open-telemetry/opentelemetry-cpp/pull/3038)

* [Code Health] include-what-you-use cleanup, part 3
[#3004](https://github.com/open-telemetry/opentelemetry-cpp/pull/3004)

* [SDK] Fix overflow in timeout logic
[#3046](https://github.com/open-telemetry/opentelemetry-cpp/pull/3046)

* [TEST] Add missing tests to Bazel build
[#3045](https://github.com/open-telemetry/opentelemetry-cpp/pull/3045)

* [TEST] update collector tests with debug exporter
[#3050](https://github.com/open-telemetry/opentelemetry-cpp/pull/3050)

* [EXAMPLE] update collector example with debug exporter
[#3049](https://github.com/open-telemetry/opentelemetry-cpp/pull/3049)

* [TEST] update references to logging exporter
[#3053](https://github.com/open-telemetry/opentelemetry-cpp/pull/3053)

* [EXAMPLE] Clean the tracer initialization in OStream example
[#3051](https://github.com/open-telemetry/opentelemetry-cpp/pull/3051)

* [EXPORTER] Fix the format of SpanLink for ETW
[#3054](https://github.com/open-telemetry/opentelemetry-cpp/pull/3054)

* [EXPORTER] Add in-memory metric exporter
[#3043](https://github.com/open-telemetry/opentelemetry-cpp/pull/3043)

* [Code Health] include-what-you-use cleanup, part 4
[#3040](https://github.com/open-telemetry/opentelemetry-cpp/pull/3040)

* [BUILD] add loongarch info
[#3052](https://github.com/open-telemetry/opentelemetry-cpp/pull/3052)

* [CI] Update otel-collector version
[#3067](https://github.com/open-telemetry/opentelemetry-cpp/pull/3067)

* [SDK] Update MetricProducer interface to match spec
[#3044](https://github.com/open-telemetry/opentelemetry-cpp/pull/3044)

* [EXPORTER] Fix URL in ES exporter, fix ipv6 supporting for http client
[#3081](https://github.com/open-telemetry/opentelemetry-cpp/pull/3081)

* [EXPORTER] Add HttpHeaders in ElasticsearchLogRecordExporter
[#3083](https://github.com/open-telemetry/opentelemetry-cpp/pull/3083)

Breaking changes:

* [REMOVAL] Remove build option `WITH_DEPRECATED_SDK_FACTORY`
Expand Down
6 changes: 3 additions & 3 deletions api/include/opentelemetry/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
# define OPENTELEMETRY_ABI_VERSION_NO 1
#endif

#define OPENTELEMETRY_VERSION "1.16.1"
#define OPENTELEMETRY_VERSION "1.17.0"
#define OPENTELEMETRY_VERSION_MAJOR 1
#define OPENTELEMETRY_VERSION_MINOR 16
#define OPENTELEMETRY_VERSION_PATCH 1
#define OPENTELEMETRY_VERSION_MINOR 17
#define OPENTELEMETRY_VERSION_PATCH 0

#define OPENTELEMETRY_ABI_VERSION OPENTELEMETRY_STRINGIFY(OPENTELEMETRY_ABI_VERSION_NO)

Expand Down
2 changes: 1 addition & 1 deletion docs/public/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
author = 'OpenTelemetry authors'

# The full version, including alpha/beta/rc tags
release = "1.16.1"
release = "1.17.0"

# Run sphinx on subprojects and copy output
# -----------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ namespace logs
*/
struct ElasticsearchExporterOptions
{
using HttpHeaders = std::multimap<std::string, std::string>;

// Configuration options to establish Elasticsearch connection
std::string host_;
int port_;
Expand All @@ -37,6 +39,9 @@ struct ElasticsearchExporterOptions
// Whether to print the status of the exporter in the console
bool console_debug_;

/** Additional HTTP headers. */
HttpHeaders http_headers_;

/**
* Constructor for the ElasticsearchExporterOptions. By default, the endpoint is
* localhost:9200/logs with a timeout of 30 seconds and disabled console debugging
Expand All @@ -47,16 +52,18 @@ struct ElasticsearchExporterOptions
* from elasticsearch
* @param console_debug If true, print the status of the exporter methods in the console
*/
ElasticsearchExporterOptions(std::string host = "localhost",
int port = 9200,
std::string index = "logs",
int response_timeout = 30,
bool console_debug = false)
ElasticsearchExporterOptions(std::string host = "localhost",
int port = 9200,
std::string index = "logs",
int response_timeout = 30,
bool console_debug = false,
HttpHeaders http_headers = {})
: host_{host},
port_{port},
index_{index},
response_timeout_{response_timeout},
console_debug_{console_debug}
console_debug_{console_debug},
http_headers_{http_headers}
{}
};

Expand Down
7 changes: 7 additions & 0 deletions exporters/elasticsearch/src/es_log_record_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,13 @@ sdk::common::ExportResult ElasticsearchLogRecordExporter::Export(
request->SetUri(options_.index_ + "/_bulk?pretty");
request->SetMethod(http_client::Method::Post);
request->AddHeader("Content-Type", "application/json");

// Add options headers
for (auto it = options_.http_headers_.cbegin(); it != options_.http_headers_.cend(); ++it)
{
request->AddHeader(it->first, it->second);
}

request->SetTimeoutMs(std::chrono::milliseconds(1000 * options_.response_timeout_));

// Create the request body
Expand Down
2 changes: 1 addition & 1 deletion sdk/include/opentelemetry/sdk/version/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#pragma once

#define OPENTELEMETRY_SDK_VERSION "1.16.1"
#define OPENTELEMETRY_SDK_VERSION "1.17.0"

#include "opentelemetry/version.h"

Expand Down
10 changes: 5 additions & 5 deletions sdk/src/version/version.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ namespace sdk
namespace version
{
const int major_version = 1;
const int minor_version = 16;
const int patch_version = 1;
const int minor_version = 17;
const int patch_version = 0;
const char *pre_release = "NONE";
const char *build_metadata = "NONE";
const char *short_version = "1.16.1";
const char *full_version = "1.16.1-NONE-NONE";
const char *build_date = "Wed Jul 17 17:34:38 UTC 2024";
const char *short_version = "1.17.0";
const char *full_version = "1.17.0-NONE-NONE";
const char *build_date = "Mon Oct 7 08:55:12 PM UTC 2024";
} // namespace version
} // namespace sdk
OPENTELEMETRY_END_NAMESPACE

0 comments on commit d010ced

Please sign in to comment.