-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Revert "[Agent] Remove heartbeat from bundled beats in agent." #22695
Conversation
This reverts commit 39b1db8.
Pinging @elastic/ingest-management (Team:Ingest Management) |
💔 Tests Failed
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪Test errorsExpand to view the tests failures
|
Test | Results |
---|---|
Failed | 1 |
Passed | 45755 |
Skipped | 4762 |
Total | 50518 |
Genuine test errors
💔 There are test failures but not known flaky tests, most likely a genuine test failure.
- Name:
Build&Test / winlogbeat-windows-windows-2008-r2 / TestOpenInvalidProvider – github.com/elastic/beats/v7/winlogbeat/eventlog
@elasticmachine merge upstream |
Pinging @elastic/uptime (Team:Uptime) |
if this is just to ease up development on apm side and not a product wise decision i think it would be better to focus on this issue instead #19623 or something similar so you can pack in HB on demand |
We need to have the bundling discussion again. I'm suggesting to first add support for heartbeat and not bundle it to unblock @shahzad31 and we will have a follow up discussion on bundling it or not as a follow up. |
There is a related discussion issue open regarding the packaging of Synthetics/Heartbeat/Agent |
Pinging @elastic/agent (Team:Agent) |
As a note on testing, in the
Use You can unpack the
|
The commit doesn't seem to be included in this PR, but the idea looks good to me. |
@urso apologies, pushed to the wrong remote, it's now updated. |
heartbeat/monitors/factory.go
Outdated
@@ -52,9 +53,16 @@ type publishSettings struct { | |||
// Output meta data settings | |||
Pipeline string `config:"pipeline"` // ES Ingest pipeline name | |||
Index fmtstr.EventFormatString `config:"index"` // ES output index pattern | |||
DataStream *datastream `config:"data_stream"` | |||
DataSet string `config:"dataset"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like you are missing a go fmt
heartbeat/monitors/factory.go
Outdated
index := fmt.Sprintf("%s-%s-%s", | ||
settings.DataStream.Type, | ||
settings.DataStream.Dataset, | ||
settings.DataStream.Namespace) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if Type
is not set you might want to set it to synthetics
. Empty Dataset
=> generic
, or empty Namespace
would be default
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmmm, I actually wonder if we should just hardcode the type
is there actually use-case for overriding it given that heartbeat only ever produces the one type?
Do we require modifications to the |
@urso we have not tested it yet, @justinkambic and @dominiqueclarke are working on the package and should be testing it against this branch shortly. I believe the spec should work fine here. Are there specific concerns you have? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
heartbeat/monitors/factory.go
Outdated
dataset := settings.DataSet | ||
if dataset == "" { | ||
dataset = "uptime" | ||
if settings.DataStream.Dataset != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DataStream is a pointer. Do we need a nil
check here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
heartbeat/monitors/factory.go
Outdated
|
||
index := fmt.Sprintf("%s-%s-%s", | ||
typ, | ||
settings.DataStream.Dataset, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should top-level Dataset
take precedence?
how about:
func defaultStr(str, def string) string {
if str != "" {
return str
}
return def
}
...
index := fmt.Sprintf("%s-%s-%s",
defaultStr(settings.DataStream.Type, "synthetics"),
defaultStr(settings.Dataset, defaultStr(settings.DataStream.Dataset, "generic")),
defaultStr(settings.DataStream.Namespace, "default")
)
heartbeat/monitors/factory.go
Outdated
} | ||
typ := settings.DataStream.Type | ||
if typ == "" { | ||
typ = "generic" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be synthetics
, such that the index name becomes synthetics-...
by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think I misunderstood a previous discussion of ours, glad to change it
heartbeat/monitors/factory_test.go
Outdated
Version: "8.0.0", | ||
} | ||
tests := []struct { | ||
name string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, remove name and:
tests := map[string]struct { ... }
/test |
Adding heartbeat into agent, since we are restarting work on fleet integration with uptime/heartbeat in 7.11
Reverts #21602