mirror of
https://github.com/matter-labs/teepot.git
synced 2025-07-24 00:04:47 +02:00
Merge pull request #271 from matter-labs/Metadata-Flavor
fix(teepot): add custom HTTP header for google metadata and update default endpoint
This commit is contained in:
commit
4d273076ee
1 changed files with 7 additions and 2 deletions
|
@ -39,7 +39,12 @@ pub struct HttpSource<F: Format> {
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl<F: Format + Send + Sync + Debug> AsyncSource for HttpSource<F> {
|
impl<F: Format + Send + Sync + Debug> AsyncSource for HttpSource<F> {
|
||||||
async fn collect(&self) -> Result<Map<String, config::Value>, ConfigError> {
|
async fn collect(&self) -> Result<Map<String, config::Value>, ConfigError> {
|
||||||
let response = match reqwest::get(&self.uri)
|
let response = match reqwest::Client::builder()
|
||||||
|
.build()
|
||||||
|
.map_err(|e| ConfigError::Foreign(Box::new(e)))?
|
||||||
|
.get(&self.uri)
|
||||||
|
.header("Metadata-Flavor", "Google")
|
||||||
|
.send()
|
||||||
.await
|
.await
|
||||||
.map_err(|e| ConfigError::Foreign(Box::new(e)))
|
.map_err(|e| ConfigError::Foreign(Box::new(e)))
|
||||||
{
|
{
|
||||||
|
@ -142,7 +147,7 @@ impl Default for TelemetryOtlpConfig {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
enable: true,
|
enable: true,
|
||||||
endpoint: "127.0.0.1:4317".to_string(),
|
endpoint: "http://127.0.0.1:4317".to_string(),
|
||||||
protocol: "grpc".to_string(),
|
protocol: "grpc".to_string(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue