Skip to content

Commit 2d6f2c9

Browse files
committed
Fix styling for the kbd elements
1 parent efca25d commit 2d6f2c9

3 files changed

Lines changed: 26 additions & 8 deletions

File tree

content/posts/elasticsearch-indices-grafana.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Optimize Grafana dashboards with Elasticsearch index aliases"
3-
description: >
4-
Elasticsearch aliases can apply filters automatically to your queries.
3+
description: >
4+
Elasticsearch aliases can apply filters automatically to your queries.
55
Let's use it to speed up some Grafana dashboards."
66
tags: ["grafana", "elasticsearch"]
77
date: 2018-12-20T00:00:00+01:00
@@ -79,7 +79,7 @@ this detail is not important). The relevant section is the
7979
}
8080
```
8181

82-
We can see that Grafana is applying a
82+
We can see that Grafana is applying a
8383
[Filtered Query](https://www.elastic.co/guide/en/elasticsearch/reference/6.5/query-dsl-filtered-query.html).
8484
One small detail is that whatever we put in our "Lucene query" input field will
8585
be placed in the `query_string` section, as an extra *filter*. This is
@@ -116,10 +116,10 @@ of how efficient ES/Lucene is.
116116
## Time to profile
117117

118118
At this point, there is not a lot of things that we can do, except profiling the
119-
query. Kibana comes bundled with a
119+
query. Kibana comes bundled with a
120120
[Search Profiler](https://www.elastic.co/guide/en/kibana/current/xpack-profiler.html)
121121
with the basic version of X-pack. Putting the query in the profiler and hitting
122-
the <kbd>Profile</kbd> button already provided a lot of insight:
122+
the {{< button >}}Profile{{< /button >}} button already provided a lot of insight:
123123

124124
![Profile of the original Grafana query](/images/elasticsearch-indices-grafana/original-query-profile.png "Profiling of the original query taking a long time")
125125

@@ -173,7 +173,7 @@ we can disregard for the sake of this article*. Of course, executing this over
173173
{
174174
"index" : "accesslogs-2018.12.10",
175175
"valid" : true,
176-
"explanation" : "#@timestamp:[1544315703107 TO 1544445303107]
176+
"explanation" : "#@timestamp:[1544315703107 TO 1544445303107]
177177
#(+(header.senderId:www1 header.senderId:www2 ... )"
178178
}
179179
]
@@ -229,7 +229,7 @@ And check the internal query that ES will execute in the profiler:
229229
"index" : "accesslogs-2018.12.10",
230230
"valid" : true,
231231
"explanation" : "(ConstantScore(+
232-
@timestamp:[1544315703107 TO 1544445303107]
232+
@timestamp:[1544315703107 TO 1544445303107]
233233
+header.senderId:(www1 www2 ...)))^0.0"
234234
}
235235
]
@@ -270,7 +270,7 @@ Elasticsearch supports the use of
270270
[*aliases*](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html).
271271
This allows having a different name of referencing some index. Think on a pointer
272272
to an actual index (very similar to a symbolic link). What is even more
273-
powerful is that we can have
273+
powerful is that we can have
274274
[*filtered aliases*](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html#filtered).
275275

276276
According to the documentation:

layouts/shortcodes/button.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<!-- info -->
2+
<kbd>
3+
{{ .Inner | markdownify }}
4+
</kbd>
5+
<!-- image -->

themes/jorgelbg/static/css/style.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ aside {
6161
--main-color: #5a67d8;
6262
--light-gray: #eee;
6363
--background-color: white;
64+
--button-background: linear-gradient(178deg, #fff, #fff, #fff, #ddd);
6465
}
6566

6667
html {
@@ -88,6 +89,7 @@ body {
8889
--background-color: #2e2e2e;
8990
--text-color: #cbd5e0;
9091
--light-gray: #4a5568;
92+
--button-background: none;
9193
}
9294

9395
article svg {
@@ -942,3 +944,14 @@ span.tag > a {
942944
.page-404 svg {
943945
width: 100%;
944946
}
947+
948+
kbd {
949+
border: 1px solid #aaa;
950+
border-radius: 4px;
951+
display: inline-block;
952+
padding: 0px 9px;
953+
background: var(--button-background);
954+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
955+
Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
956+
font-size: 1rem;
957+
}

0 commit comments

Comments
 (0)