Skip to content

Conversation

@tmb-piXel
Copy link

No description provided.

@tmb-piXel tmb-piXel requested a review from a team February 5, 2024 18:38
@bits-bot
Copy link

bits-bot commented Feb 5, 2024

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the domain: sources Anything related to the Vector's sources label Feb 5, 2024
@jszwedko jszwedko requested a review from dsmith3197 February 5, 2024 18:44
let mut components = path.rsplit('/');
let delimiter;

if path.chars().nth(4) == Some('/') {
Copy link
Member

@jszwedko jszwedko Feb 8, 2024

Choose a reason for hiding this comment

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

Rather than looking at the filepath to try to determine the host system, could we instead use std::path::MAIN_SEPARATOR which should be / on Linux and \ on Windows?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, thanks for the idea, I changed it to MAIN_SEPARATOR. I think this will be right.

Copy link
Member

@jszwedko jszwedko left a comment

Choose a reason for hiding this comment

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

Thanks! One other thing that I forgot to ask for: can you add a changelog fragment for this change? See https://github.com/vectordotdev/vector/blob/master/changelog.d/README.md

Co-authored-by: Jesse Szwedko <jesse@szwedko.me>
@jszwedko jszwedko enabled auto-merge February 14, 2024 19:07
Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>
@jszwedko jszwedko added this pull request to the merge queue Feb 15, 2024
@github-actions
Copy link

Regression Detector Results

Run ID: 39505e97-d21a-47a7-aa9b-c3199f8650e9
Baseline: a7fe0db
Comparison: 09fab9b
Total CPUs: 7

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

No significant changes in experiment optimization goals

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI
http_to_http_acks ingress throughput +1.20 [-0.13, +2.52]
http_elasticsearch ingress throughput +1.00 [+0.93, +1.07]
syslog_splunk_hec_logs ingress throughput +0.78 [+0.72, +0.83]
datadog_agent_remap_datadog_logs_acks ingress throughput +0.57 [+0.48, +0.65]
splunk_hec_route_s3 ingress throughput +0.45 [-0.04, +0.95]
syslog_log2metric_humio_metrics ingress throughput +0.40 [+0.30, +0.50]
datadog_agent_remap_datadog_logs ingress throughput +0.25 [+0.16, +0.33]
http_to_s3 ingress throughput +0.11 [-0.17, +0.39]
http_to_http_json ingress throughput +0.07 [-0.01, +0.15]
http_to_http_noack ingress throughput +0.04 [-0.04, +0.13]
splunk_hec_to_splunk_hec_logs_acks ingress throughput +0.00 [-0.16, +0.16]
splunk_hec_indexer_ack_blackhole ingress throughput -0.00 [-0.14, +0.14]
otlp_grpc_to_blackhole ingress throughput -0.03 [-0.11, +0.06]
splunk_hec_to_splunk_hec_logs_noack ingress throughput -0.03 [-0.14, +0.09]
otlp_http_to_blackhole ingress throughput -0.07 [-0.21, +0.06]
enterprise_http_to_http ingress throughput -0.08 [-0.17, -0.00]
fluent_elasticsearch ingress throughput -0.24 [-0.71, +0.23]
datadog_agent_remap_blackhole ingress throughput -0.29 [-0.39, -0.20]
syslog_loki ingress throughput -0.41 [-0.46, -0.36]
syslog_log2metric_splunk_hec_metrics ingress throughput -0.43 [-0.57, -0.29]
socket_to_socket_blackhole ingress throughput -0.62 [-0.69, -0.55]
http_text_to_http_json ingress throughput -0.67 [-0.80, -0.53]
syslog_regex_logs2metric_ddmetrics ingress throughput -0.69 [-0.84, -0.54]
datadog_agent_remap_blackhole_acks ingress throughput -0.86 [-0.95, -0.77]
syslog_humio_logs ingress throughput -0.96 [-1.05, -0.88]
file_to_blackhole egress throughput -1.02 [-3.49, +1.44]
syslog_log2metric_tag_cardinality_limit_blackhole ingress throughput -2.16 [-2.29, -2.02]

Explanation

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 15, 2024
@jszwedko
Copy link
Member

This change caused a test failure on Windows:

#[test]
fn test_annotate_from_file_info() {
let cases = vec![(
FieldsSpec::default(),
"/var/log/pods/sandbox0-ns_sandbox0-name_sandbox0-uid/sandbox0-container0-name/1.log",
{
let mut log = LogEvent::default();
log.insert(event_path!("kubernetes", "container_name"), "sandbox0-container0-name");
log
},
LogNamespace::Legacy,
),(
FieldsSpec{
container_name: OwnedTargetPath::event(owned_value_path!("container_name")).into(),
..Default::default()
},
"/var/log/pods/sandbox0-ns_sandbox0-name_sandbox0-uid/sandbox0-container0-name/1.log",
{
let mut log = LogEvent::default();
log.insert(event_path!("container_name"), "sandbox0-container0-name");
log
},
LogNamespace::Legacy,
)];
for (fields_spec, file, expected, log_namespace) in cases.into_iter() {
let mut log = LogEvent::default();
let file_info = parse_log_file_path(file).unwrap();
annotate_from_file_info(&mut log, &fields_spec, &file_info, log_namespace);
assert_eq!(log, expected);
}
}

This appears to be because the test is using unix-style path delimiters. I think it needs to be updated to use https://doc.rust-lang.org/std/path/struct.Path.html#method.join.

@tmb-piXel
Copy link
Author

I can add the following code to the test
`

fn test_annotate_from_file_info() {
    let path;
    let path_linux = String::from("/var/log/pods/sandbox0-ns_sandbox0-name_sandbox0-uid/sandbox0-container0-name/1.log");
    let path_windows = String::from("/var\\log\\pods\\sandbox0-ns_sandbox0-name_sandbox0-uid\\sandbox0-container0-name\\1.log");

    let os = std::env::consts::OS;

    if os == "windows" {
        path = path_windows;
    } else {
        path = path_linux;
    }

    let cases = vec![(
        FieldsSpec::default(),
        path,
        {
            let mut log = LogEvent::default();
            log.insert(event_path!("kubernetes", "container_name"), "sandbox0-container0-name");
            log
        },
        LogNamespace::Legacy,
    ),(
        FieldsSpec{
            container_name: OwnedTargetPath::event(owned_value_path!("container_name")).into(),
            ..Default::default()
        },
        path,
        {
            let mut log = LogEvent::default();
            log.insert(event_path!("container_name"), "sandbox0-container0-name");
            log
        },
        LogNamespace::Legacy,
    )];

    for (fields_spec, file, expected, log_namespace) in cases.into_iter() {
        let mut log = LogEvent::default();
        let file_info = parse_log_file_path(file).unwrap();
        annotate_from_file_info(&mut log, &fields_spec, &file_info, log_namespace);
        assert_eq!(log, expected);
    }
}`

@jszwedko
Copy link
Member

@tmb-piXel I'd suggest just doing something like:

let path = ["var", "log", (etc)].iter().collect::<PathBuf>()

that way it'll create the right path for the platform the test is running on rather than you needing to have a conditional in the test file depending on platform. Does that make sense?

@neuronull neuronull removed the request for review from dsmith3197 March 19, 2024 19:04
@jszwedko jszwedko requested a review from a team as a code owner October 3, 2024 18:54
damoxc added a commit to damoxc/vector that referenced this pull request Oct 15, 2024
This implements the changes from vectordotdev#19799, including the suggested fix for
the failing test. I've been running the change with the path separator
successfully for 5 months now.
github-merge-queue bot pushed a commit that referenced this pull request Oct 28, 2024
…ubernetes log files on Windows (#21505)

* support scraping metadata from Kubernetes log files on Windows

This implements the changes from #19799, including the suggested fix for
the failing test. I've been running the change with the path separator
successfully for 5 months now.

* add changelog entry for #18521 fix

* fix typo in changelog entry

* Update changelog.d/18521-kubernetes-windows-metadata.enhancement.md

* cargo fmt

Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>

* Add missing import

Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>

* fix type differences in the new path test cases

* run cargo fmt

---------

Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>
Co-authored-by: Jesse Szwedko <jesse@szwedko.me>
Co-authored-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>
@thomasqueirozb
Copy link
Contributor

This now has some merge conflicts.

Also is it causing a reproducible issue or does it fix an open issue? PR is missing a description

@thomasqueirozb thomasqueirozb added the meta: awaiting author Pull requests that are awaiting their author. label Jun 13, 2025
@pront pront force-pushed the master branch 4 times, most recently from 1720078 to ffe54be Compare July 10, 2025 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: sources Anything related to the Vector's sources meta: awaiting author Pull requests that are awaiting their author.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants