Skip to content

Commit

Permalink
Rename meanings to meaning
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Wakely <fungus.humungus@gmail.com>
  • Loading branch information
StephenWakely committed Jul 14, 2023
1 parent c825ccd commit 1dc1637
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 37 deletions.
17 changes: 0 additions & 17 deletions lib/vector-core/src/schema/meanings.rs

This file was deleted.

2 changes: 1 addition & 1 deletion lib/vector-core/src/schema/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mod definition;
pub mod meanings;
pub mod meaning;
mod requirement;

pub use definition::Definition;
Expand Down
10 changes: 5 additions & 5 deletions src/codecs/encoding/transformer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use lookup::{
use serde::{Deserialize, Deserializer};
use vector_config::configurable_component;
use vector_core::event::{LogEvent, MaybeAsLogMut};
use vector_core::schema::meanings;
use vector_core::schema::meaning;
use vrl::value::Value;

use crate::{event::Event, serde::skip_serializing_if_default};
Expand Down Expand Up @@ -143,12 +143,12 @@ impl Transformer {
let service_path = log
.metadata()
.schema_definition()
.meaning_path(meanings::SERVICE);
.meaning_path(meaning::SERVICE);
if let Some(service_path) = service_path {
let mut new_log = LogEvent::from(old_value);
if let Some(service) = new_log.remove(service_path) {
log.metadata_mut()
.add_dropped_field(meanings::SERVICE.to_string(), service);
.add_dropped_field(meaning::SERVICE.to_string(), service);
}
}
}
Expand All @@ -161,7 +161,7 @@ impl Transformer {
let service_path = log
.metadata()
.schema_definition()
.meaning_path(meanings::SERVICE)
.meaning_path(meaning::SERVICE)
.map(|path| path.value_path().to_string());

for field in except_fields {
Expand All @@ -172,7 +172,7 @@ impl Transformer {
if let Some(v) = value {
if matches!(service_path.as_ref(), Some(path) if path == field) {
log.metadata_mut()
.add_dropped_field(meanings::SERVICE.to_string(), v);
.add_dropped_field(meaning::SERVICE.to_string(), v);
}
}
}
Expand Down
16 changes: 8 additions & 8 deletions src/sinks/datadog/logs/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::{convert::TryFrom, sync::Arc};
use indoc::indoc;
use tower::ServiceBuilder;
use vector_config::configurable_component;
use vector_core::{config::proxy::ProxyConfig, schema::meanings};
use vector_core::{config::proxy::ProxyConfig, schema::meaning};
use vrl::value::Kind;

use super::{service::LogApiRetry, sink::LogSinkBuilder};
Expand Down Expand Up @@ -176,13 +176,13 @@ impl SinkConfig for DatadogLogsConfig {

fn input(&self) -> Input {
let requirement = schema::Requirement::empty()
.required_meaning(meanings::MESSAGE, Kind::bytes())
.required_meaning(meanings::TIMESTAMP, Kind::timestamp())
.optional_meaning(meanings::HOST, Kind::bytes())
.optional_meaning(meanings::SOURCE, Kind::bytes())
.optional_meaning(meanings::SEVERITY, Kind::bytes())
.optional_meaning(meanings::SERVICE, Kind::bytes())
.optional_meaning(meanings::TRACE_ID, Kind::bytes());
.required_meaning(meaning::MESSAGE, Kind::bytes())
.required_meaning(meaning::TIMESTAMP, Kind::timestamp())
.optional_meaning(meaning::HOST, Kind::bytes())
.optional_meaning(meaning::SOURCE, Kind::bytes())
.optional_meaning(meaning::SEVERITY, Kind::bytes())
.optional_meaning(meaning::SERVICE, Kind::bytes())
.optional_meaning(meaning::TRACE_ID, Kind::bytes());

Input::log().with_schema_requirement(requirement)
}
Expand Down
1 change: 0 additions & 1 deletion src/sinks/new_relic/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ impl SinkConfig for NewRelicConfig {

let sink = NewRelicSink {
service,
transformer: self.encoding.clone(),
encoder: NewRelicEncoder {
transformer: self.encoding.clone(),
credentials: Arc::clone(&credentials),
Expand Down
1 change: 0 additions & 1 deletion src/sinks/new_relic/sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ impl RequestBuilder<Vec<Event>> for NewRelicRequestBuilder {

pub struct NewRelicSink<S> {
pub service: S,
pub transformer: Transformer,
pub encoder: NewRelicEncoder,
pub credentials: Arc<NewRelicCredentials>,
pub compression: Compression,
Expand Down
8 changes: 4 additions & 4 deletions src/sources/splunk_hec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use vector_config::configurable_component;
use vector_core::{
config::{LegacyKey, LogNamespace},
event::BatchNotifier,
schema::meanings,
schema::meaning,
EstimatedJsonEncodedSizeOf,
};
use vrl::value::{kind::Collection, Kind};
Expand Down Expand Up @@ -184,7 +184,7 @@ impl SourceConfig for SplunkConfig {
.with_event_field(
&owned_value_path!(log_schema().message_key()),
Kind::bytes().or_undefined(),
Some(meanings::MESSAGE),
Some(meaning::MESSAGE),
)
.with_event_field(
&owned_value_path!("line"),
Expand All @@ -206,7 +206,7 @@ impl SourceConfig for SplunkConfig {
))),
&owned_value_path!("host"),
Kind::bytes(),
Some(meanings::HOST),
Some(meaning::HOST),
)
.with_source_metadata(
SplunkConfig::NAME,
Expand All @@ -227,7 +227,7 @@ impl SourceConfig for SplunkConfig {
Some(LegacyKey::Overwrite(owned_value_path!(SOURCE))),
&owned_value_path!("source"),
Kind::bytes(),
Some(meanings::SERVICE),
Some(meaning::SERVICE),
)
// Not to be confused with `source_type`.
.with_source_metadata(
Expand Down

0 comments on commit 1dc1637

Please sign in to comment.