Skip to content

Commit 79d8f5f

Browse files
committed
docs
1 parent 44b582b commit 79d8f5f

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

README-ELK-analysys.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Example event shape:
1010
{
1111
"timestampMillis": "1773395676972",
1212
"stack": [
13-
"de.otto.droporder.cockpit.model.DlqStorageModel.payloadHash()"
13+
"some.package.a.b.model.DlqStorageModel.payloadHash()"
1414
]
1515
}
1616
```
@@ -28,7 +28,7 @@ Example event shape:
2828

2929
## What you can answer with this guide
3030

31-
- Which events contain class `de.otto.droporder.cockpit.model.DlqStorageModel`?
31+
- Which events contain class `some.package.a.b.model.DlqStorageModel`?
3232
- How often was that class hit over time?
3333
- Which methods are called most often?
3434
- Which classes/methods are hot overall?
@@ -215,7 +215,7 @@ GET tcp-events-*/_search
215215
"query": {
216216
"wildcard": {
217217
"stack.keyword": {
218-
"value": "de.otto.droporder.cockpit.model.DlqStorageModel*"
218+
"value": "some.package.a.b.model.DlqStorageModel*"
219219
}
220220
}
221221
}
@@ -229,7 +229,7 @@ GET tcp-events-*/_search
229229
"query": {
230230
"wildcard": {
231231
"stack.keyword": {
232-
"value": "de.otto.droporder.cockpit.model.DlqStorageModel*"
232+
"value": "some.package.a.b.model.DlqStorageModel*"
233233
}
234234
}
235235
},
@@ -251,7 +251,7 @@ GET tcp-events-*/_search
251251

252252
1. Open Visualization Library -> Create New -> Lens with data view `jct-events-*`.
253253
2. Filter (KQL):
254-
`stack.keyword : "de.otto.droporder.cockpit.model.DlqStorageModel*"`
254+
`stack.keyword : "some.package.a.b.model.DlqStorageModel*"`
255255
3. X-axis: Date histogram on `@timestamp`.
256256
4. Y-axis: Count.
257257
5. Save as `DlqStorageModel calls over time`.

tools/format_stack.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
Output example:
1919
# package class method
2020
───────────────────────────────────────────────────────────────────────────────────
21-
1 o.b.s.u.ldap LdapConnectionFactory .inititialize(LdapConnectionConfigurationDTO)
21+
1 de.a.security.utils.ldap LdapConnectionFactory .inititialize(LdapConnectionConfigurationDTO)
2222
2 .connect()
23-
3 o.b.s.u.ldap LdapConnectionConfigurationDTO .getLdapServer1()
23+
3 de.b.security.utils.ldap LdapConnectionConfigurationDTO .getLdapServer1()
2424
...
2525
"""
2626

@@ -93,16 +93,13 @@ def split_entry(entry: str) -> tuple[str, str, str, str]:
9393
# ---------------------------------------------------------------------------
9494

9595
def abbreviate_pkg(pkg: str) -> str:
96-
"""'otto.b2b.security.utils.ldap' -> 'o.b.s.u.ldap'"""
97-
parts = pkg.split(".")
98-
if len(parts) <= 2:
99-
return pkg
100-
return ".".join(p[0] for p in parts[:-1]) + "." + parts[-1]
96+
"""Return the package as-is — full names are easier to read than abbreviations."""
97+
return pkg
10198

10299

103100
def shorten_args(raw_args: str) -> str:
104101
"""'(a.b.c.Foo, x.y.Bar)' -> '(Foo, Bar)'"""
105-
return re.sub(r"[\w]+\.(\w+)", r"\1", raw_args)
102+
return re.sub(r"(?:\w+\.)+(\w+)", r"\1", raw_args)
106103

107104

108105
# ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)