-
Notifications
You must be signed in to change notification settings - Fork 525
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
Kibana Index Patterns going out-of-sync #991
Comments
For (3), a slight adoption of this change would enable us to export the index pattern to a file using APM Server. |
You obviously thought about this more than me, but I do think that a dependency on Kibana is a problem... |
Thanks for the write up @sqren. I agree 3 is the best option. One concern: If a user has old and current APM servers / Beats, and one of the older ones is restarted, it'd end up replacing a current index pattern with an old one? |
This is possible now (unless I'm missing something) with:
That does overwrite the existing pattern unconditionally and allows apm-server to continue operating if kibana is unavailable, reducing the kibana dependency. I would argue these should be the default on cloud - would making these the default solve the issue? Is it ok to get the dashboards along with the index pattern? Did I completely miss something? |
@graphaelli The user has to run |
Oh, are you saying that just adding those to the config does the trick? Then yeah, maybe just having them in there by default would work. |
Since we are moving importing of dashboards to Kibana, the option should perhaps be renamed to |
Do we plan to remove dashboard loading from apm-server when kibana is able to import them or will they do the same thing? If they're removed
We can probably do that. The There's still the issue @makwarth brought up (if this defaults to on):
|
@roncohen mentioned that we should leave it in the apm-server but I'm not sure why that is useful. The dashboard import feature will be in the Getting Started guide (not APM ui) so will be able to both xpack and OSS users.
Not important at all. Just thought it would be helpful to separate the notion of creating dashboards vs creating index patterns
True, and @ruflin also brought that up. Not sure how that should be handled tbh. |
Agree, it doesn't make sense to have dashboards in the Server any longer, imo. |
@graphaelli Let's move forward with your suggestion #991 (comment). I'll join the apm-server meeting today with @makwarth and we can hash out the details. |
I don't think i was talking about the dashboards. What i was maybe saying was that we should think twice about removing index pattern generation from the APM Server and store a hardcoded file in Kibana because as opposed to in Kibana, we have a high level way to define the index pattern in the APM Server ( |
It's only been a few days, but wanted to follow up on this as all new 6.4 UI features depend on this. Regarding this:
I don't think it's a blocker for 6.4, but would something like this be possible: In the APM Server, check if the Server's version is lower than other Servers ingesting to the ES cluster. If yes, the APM Server should not update the index pattern on start/restart. (I write APM Server, but I assume this functionality is really in libbeat) |
We've been talking about this again, we think that creating the indexpatterns from the server seems to be the first solution. We are still deciding on how to handle different versions. @sqren is there a way to use more than one index pattern or you can use only one? |
@alvarolobato @simitt and I talked about different solutions. We are currently investigating what's |
@sqren I investigated the version handling idea. Adding the version to the
Issue: libbeat does not handle using Using this approach I tested the behaviour of dashboards and the curated UI:
If we want to go forward with this idea we would need to
|
fyi: Query bar and ML are the only consumers of index patterns, and they are not in master yet, so might get a false positive result. |
To fetch the index patterns, I assume the UI would have to get a list of index patterns, and select the latest one. Is that correct? |
Solution A: Overwriting logic is in Kibana Solution B: No overwriting logic. APM-Server overwrites every time regardless of version APM UI still needs a strategy when no index pattern has been created. This could happen if the user is running apm-server 6.3 or below. |
Thanks for the update. Few comments / questions: 1/
With this we're targeting to remove the index pattern creation from the APM Server in 6.5 and move the functionality to Kibana with the update of 2/ Does this mean that Import Dashboards in the Kibana Add data tutorial will be disabled until it can detect an index pattern? That index pattern can come from booting up the APM Server or creating it manually in Management/Index Patterns 3/ Follow up on 2): If I remember correctly, when manually creating the Index Patterns in Kibana, the field types weren't set correctly? Is this a blocker? 4/ We need a state for the Query bar and the ML integration, if there's no index pattern. (cc @formgeist) |
@makwarth Created a design enhancements issue for those tasks elastic/kibana#19995 cc @sqren let's chat if there's any more things needed before release. |
Yes, I hope we can add the version check in Kibana by 6.5.
Yes, that is one solution. Another is to fall back to a hardcoded index pattern (which might not match with the APM-Server version). A third is to create the index pattern automatically (with the disadvantages you describe below).
This is how I understand it, yes. But I have always used auto-created index patterns and haven't had problems, so I wonder how big a deal it is. |
After another round of discussions, we are aiming for moving the dashboards and the index patterns to Kibana. Action items for 6.4
|
Just to clarify: The index pattern and dashboards will be hardcoded in Kibana, as part of the "Add data" instructions, not the APM UI. This means they will also be accessible for non-X-Pack users. |
Notes:
|
Today the APM index pattern in Kibana is not created automatically. The user can create it manually through the Kibana UI, or by running
./apm-server setup
.There are two cases where the APM index pattern is required in the upcoming 6.4 release:
For the above cases to work correctly we either need to:
In both cases we also need to handle the case where the apm-server schema changes, which should cause an existing APM index pattern to be deleted and recreated.
Possible solutions
1. Auto-creating from Kibana by inferring the schema
I initially tried to use the
saved_objects
API in Kibana like:This will infer the field types from elasticsearch, and create the index pattern. The downside of this is:
2. Auto-creating from Kibana using a hard-coded index pattern object
Same as above, but instead of inferring the index pattern fields, a pre-defined index pattern will be created.
This would solve the problem from above where field types can't be inferred since they can now be explicitly defined in the hardcoded object.
This does not solve the problem with an existing APM index pattern coming out-of-sync when apm-server schema changes after an upgrade.
It also adds the extra requirement, that whenever apm-server schema changes, the file in Kibana containing the index pattern object must be updated.
3. Auto-creating from apm-server on startup
On startup apm-server should remove the existing APM index pattern (if it exists) and create a new APM index pattern.
This will ensure that there is always an up-to-date APM index pattern.
Is is possible to create the index pattern by calling elasticsearch directly but it is probably easier to use the
saved_objects
API in Kibana. Is it a problem that the apm-server has a dependency on Kibana?Conclusion
We should find a way to create the APM Index Pattern in Kibana, that is either easy to do for the user, or fully automated. The created index pattern needs to stay in sync with the apm-server schema.
Personally I'm most inclined to using the last solution (3), since this seems to address the problems with 1) and 2)
@simitt @roncohen @jalvz @graphaelli
The text was updated successfully, but these errors were encountered: