Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pipeline.id to log lines #11075

Merged
merged 1 commit into from
Aug 28, 2019

Conversation

andsel
Copy link
Contributor

@andsel andsel commented Aug 23, 2019

Add tag fish with pipeline.id to log lines

Copy link
Member

@robbavey robbavey left a comment

Choose a reason for hiding this comment

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

@andsel - this is awesome.

Tested locally, and this seems to work well for both ruby and java execution engines.

Ideally, I think I'd like to see an integration test, along the lines of the slowlog_spec to ensure that the pipeline.id is output with a minimal config (which could then potentially be extended when we come up with more use cases when we improve logging)

@andsel andsel force-pushed the feature/add_pipeline_id_to_log_lines branch from b8ca006 to c9ff6fd Compare August 27, 2019 07:34
Copy link
Member

@robbavey robbavey left a comment

Choose a reason for hiding this comment

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

Couple of config nitpicks, and on the name of the test.

@ls.spawn_logstash("-w", "1" , "-e", config)
@ls.wait_for_logstash
sleep 2 until @ls.exited?
pipelinelog_file = "#{temp_dir}/logstash-slowlog-plain.log"
Copy link
Member

Choose a reason for hiding this comment

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

This should be the plain.log

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually the name is logstash-plain.log and checks the plain output file

it "should write logs to a new dir" do
settings = {
"path.logs" => temp_dir,
"slowlog.threshold.warn" => "500ms"
Copy link
Member

Choose a reason for hiding this comment

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

slowlog.threshold.warn is unnecessary, as we are not testing the slowlog

count => 4
}
}
filter {
Copy link
Member

Choose a reason for hiding this comment

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

This sleep filter is unnecessary (unless you were planning on adding a test that filters are logging the pipeline name correctly)

let(:temp_dir) { Stud::Temporary.directory("logstash-pipelinelog-test") }
let(:config) { @fixture.config("root") }

it "should write logs to a new dir" do
Copy link
Member

Choose a reason for hiding this comment

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

Test name should be more descriptive of the test.

@andsel andsel force-pushed the feature/add_pipeline_id_to_log_lines branch from c9ff6fd to 9269a89 Compare August 28, 2019 14:49
Copy link
Member

@robbavey robbavey left a comment

Choose a reason for hiding this comment

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

LGTM

@elasticsearch-bot
Copy link

Joao Duarte merged this into the following branches!

Branch Commits
7.x 056c3e3
7.4 a3ac21d

elasticsearch-bot pushed a commit that referenced this pull request Aug 29, 2019
elasticsearch-bot pushed a commit that referenced this pull request Aug 29, 2019
kares added a commit to kares/logstash that referenced this pull request Nov 27, 2019
this is fairly recent - since 7.4 (added in elasticGH-11075)

there's a risk plugins would assume ThreadContext to
exist or collide the 'global' constant - usually best
to import where the Java class actually gets used ...
kares added a commit to kares/logstash that referenced this pull request Nov 28, 2019
this is fairly recent - since 7.4 (added in elasticGH-11075)

there's a risk plugins would assume ThreadContext to
exist or collide the 'global' constant - usually best
to import where the Java class actually gets used ...
elasticsearch-bot pushed a commit that referenced this pull request Dec 2, 2019
this is fairly recent - since 7.4 (added in GH-11075)

there's a risk plugins would assume ThreadContext to
exist or collide the 'global' constant - usually best
to import where the Java class actually gets used ...

Fixes #11356
elasticsearch-bot pushed a commit that referenced this pull request Dec 2, 2019
this is fairly recent - since 7.4 (added in GH-11075)

there's a risk plugins would assume ThreadContext to
exist or collide the 'global' constant - usually best
to import where the Java class actually gets used ...

Fixes #11356
elasticsearch-bot pushed a commit that referenced this pull request Dec 2, 2019
this is fairly recent - since 7.4 (added in GH-11075)

there's a risk plugins would assume ThreadContext to
exist or collide the 'global' constant - usually best
to import where the Java class actually gets used ...

Fixes #11356
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants