Skip to content

Commit 8abd422

Browse files
authored
Merge pull request #4426 from Blargian/fix_sidebar_styling
Usability improvements to sidebar
2 parents c9a9fbc + b5de5fd commit 8abd422

File tree

5 files changed

+171
-21
lines changed

5 files changed

+171
-21
lines changed

docs/use-cases/observability/clickstack/deployment/hyperdx-clickhouse-cloud.md

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,158 @@ curl -O https://raw.githubusercontent.com/ClickHouse/clickhouse-docs/refs/heads/
6767

6868
<details>
6969
<summary>otel-cloud-config.yaml</summary>
70+
7071
```yaml file=docs/use-cases/observability/clickstack/deployment/_snippets/otel-cloud-config.yaml
72+
receivers:
73+
otlp/hyperdx:
74+
protocols:
75+
grpc:
76+
include_metadata: true
77+
endpoint: '0.0.0.0:4317'
78+
http:
79+
cors:
80+
allowed_origins: ['*']
81+
allowed_headers: ['*']
82+
include_metadata: true
83+
endpoint: '0.0.0.0:4318'
84+
processors:
85+
transform:
86+
log_statements:
87+
- context: log
88+
error_mode: ignore
89+
statements:
90+
# JSON parsing: Extends log attributes with the fields from structured log body content, either as an OTEL map or
91+
# as a string containing JSON content.
92+
- set(log.cache, ExtractPatterns(log.body, "(?P<0>(\\{.*\\}))")) where
93+
IsString(log.body)
94+
- merge_maps(log.attributes, ParseJSON(log.cache["0"]), "upsert")
95+
where IsMap(log.cache)
96+
- flatten(log.attributes) where IsMap(log.cache)
97+
- merge_maps(log.attributes, log.body, "upsert") where IsMap(log.body)
98+
- context: log
99+
error_mode: ignore
100+
conditions:
101+
- severity_number == 0 and severity_text == ""
102+
statements:
103+
# Infer: extract the first log level keyword from the first 256 characters of the body
104+
- set(log.cache["substr"], log.body.string) where Len(log.body.string)
105+
< 256
106+
- set(log.cache["substr"], Substring(log.body.string, 0, 256)) where
107+
Len(log.body.string) >= 256
108+
- set(log.cache, ExtractPatterns(log.cache["substr"],
109+
"(?i)(?P<0>(alert|crit|emerg|fatal|error|err|warn|notice|debug|dbug|trace))"))
110+
# Infer: detect FATAL
111+
- set(log.severity_number, SEVERITY_NUMBER_FATAL) where
112+
IsMatch(log.cache["0"], "(?i)(alert|crit|emerg|fatal)")
113+
- set(log.severity_text, "fatal") where log.severity_number ==
114+
SEVERITY_NUMBER_FATAL
115+
# Infer: detect ERROR
116+
- set(log.severity_number, SEVERITY_NUMBER_ERROR) where
117+
IsMatch(log.cache["0"], "(?i)(error|err)")
118+
- set(log.severity_text, "error") where log.severity_number ==
119+
SEVERITY_NUMBER_ERROR
120+
# Infer: detect WARN
121+
- set(log.severity_number, SEVERITY_NUMBER_WARN) where
122+
IsMatch(log.cache["0"], "(?i)(warn|notice)")
123+
- set(log.severity_text, "warn") where log.severity_number ==
124+
SEVERITY_NUMBER_WARN
125+
# Infer: detect DEBUG
126+
- set(log.severity_number, SEVERITY_NUMBER_DEBUG) where
127+
IsMatch(log.cache["0"], "(?i)(debug|dbug)")
128+
- set(log.severity_text, "debug") where log.severity_number ==
129+
SEVERITY_NUMBER_DEBUG
130+
# Infer: detect TRACE
131+
- set(log.severity_number, SEVERITY_NUMBER_TRACE) where
132+
IsMatch(log.cache["0"], "(?i)(trace)")
133+
- set(log.severity_text, "trace") where log.severity_number ==
134+
SEVERITY_NUMBER_TRACE
135+
# Infer: else
136+
- set(log.severity_text, "info") where log.severity_number == 0
137+
- set(log.severity_number, SEVERITY_NUMBER_INFO) where log.severity_number == 0
138+
- context: log
139+
error_mode: ignore
140+
statements:
141+
# Normalize the severity_text case
142+
- set(log.severity_text, ConvertCase(log.severity_text, "lower"))
143+
resourcedetection:
144+
detectors:
145+
- env
146+
- system
147+
- docker
148+
timeout: 5s
149+
override: false
150+
batch:
151+
memory_limiter:
152+
# 80% of maximum memory up to 2G, adjust for low memory environments
153+
limit_mib: 1500
154+
# 25% of limit up to 2G, adjust for low memory environments
155+
spike_limit_mib: 512
156+
check_interval: 5s
157+
connectors:
158+
routing/logs:
159+
default_pipelines: [logs/out-default]
160+
error_mode: ignore
161+
table:
162+
- context: log
163+
statement: route() where IsMatch(attributes["rr-web.event"], ".*")
164+
pipelines: [logs/out-rrweb]
165+
exporters:
166+
debug:
167+
verbosity: detailed
168+
sampling_initial: 5
169+
sampling_thereafter: 200
170+
clickhouse/rrweb:
171+
database: ${env:CLICKHOUSE_DATABASE}
172+
endpoint: ${env:CLICKHOUSE_ENDPOINT}
173+
password: ${env:CLICKHOUSE_PASSWORD}
174+
username: ${env:CLICKHOUSE_USER}
175+
ttl: 720h
176+
logs_table_name: hyperdx_sessions
177+
timeout: 5s
178+
retry_on_failure:
179+
enabled: true
180+
initial_interval: 5s
181+
max_interval: 30s
182+
max_elapsed_time: 300s
183+
clickhouse:
184+
database: ${env:CLICKHOUSE_DATABASE}
185+
endpoint: ${env:CLICKHOUSE_ENDPOINT}
186+
password: ${env:CLICKHOUSE_PASSWORD}
187+
username: ${env:CLICKHOUSE_USER}
188+
ttl: 720h
189+
timeout: 5s
190+
retry_on_failure:
191+
enabled: true
192+
initial_interval: 5s
193+
max_interval: 30s
194+
max_elapsed_time: 300s
195+
extensions:
196+
health_check:
197+
endpoint: :13133
198+
service:
199+
pipelines:
200+
traces:
201+
receivers: [otlp/hyperdx]
202+
processors: [memory_limiter, batch]
203+
exporters: [clickhouse]
204+
metrics:
205+
receivers: [otlp/hyperdx]
206+
processors: [memory_limiter, batch]
207+
exporters: [clickhouse]
208+
logs/in:
209+
receivers: [otlp/hyperdx]
210+
exporters: [routing/logs]
211+
logs/out-default:
212+
receivers: [routing/logs]
213+
processors: [memory_limiter, transform, batch]
214+
exporters: [clickhouse]
215+
logs/out-rrweb:
216+
receivers: [routing/logs]
217+
processors: [memory_limiter, batch]
218+
exporters: [clickhouse/rrweb]
219+
71220
```
221+
72222
</details>
73223

74224
Deploy the collector using the following Docker command, setting the respective environment variables to the connection settings recorded earlier and using the appropriate command below based on your operating system.

src/components/Feedback/index.jsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ export default function Feedback({side}) {
124124

125125
const ThumbsUp = ({ highlighted, colorMode }) => (
126126
<svg
127-
width="16"
128-
height="16"
127+
width="12"
128+
height="12"
129129
viewBox="0 0 16 16"
130130
fill="none"
131131
xmlns="http://www.w3.org/2000/svg"
@@ -158,8 +158,8 @@ export default function Feedback({side}) {
158158

159159
const ThumbsDown = ({ highlighted, colorMode }) => (
160160
<svg
161-
width="16"
162-
height="16"
161+
width="12"
162+
height="12"
163163
viewBox="0 0 16 16"
164164
fill="none"
165165
xmlns="http://www.w3.org/2000/svg"
@@ -192,13 +192,13 @@ export default function Feedback({side}) {
192192

193193
return (
194194
<div className={styles.displayFeedback}>
195-
<Panel hasBorder alignItems='start'>
195+
<Panel hasBorder alignItems='start' padding='xs'>
196196
<Popover open={open} >
197197
<Popover.Trigger>
198198
<div>
199-
<Text size='lg' color='muted' weight='semibold'>Was this page helpful?</Text>
199+
<Text size='sm' color='muted' weight='semibold'>Was this page helpful?</Text>
200200
</div>
201-
<div className='mt-[8px] flex'>
201+
<div className='mt-[6px] flex'>
202202
<div className={clsx( styles.Button, colorMode === 'dark' ? styles.dark : styles.light, selected === 'pos' && styles.selected )} onClick={() => { handleClick(true); handleSubmit(true)}}>
203203
<ThumbsUp highlighted={selected === 'pos'} colorMode={colorMode}/>
204204
</div>

src/components/Feedback/styles.module.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
}
1212

1313
.Button {
14-
width: 40px;
15-
height: 40px;
14+
width: 25px;
15+
height: 25px;
1616
display: flex;
1717
align-items: center;
1818
justify-content: center;

src/theme/DocItem/TOC/Desktop/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default function DocItemTOCDesktop() {
1414
const {toc, frontMatter} = useDoc();
1515
const [isClosed, setClosed] = useState(() => {
1616
if (typeof window !== 'undefined') {
17-
return window.sessionStorage.getItem('doc-cloud-card-banner') === 'closed';
17+
return window.localStorage.getItem('doc-cloud-card-banner') === 'closed';
1818
}
1919
return false;
2020
});
@@ -30,10 +30,10 @@ export default function DocItemTOCDesktop() {
3030
const cacheKey = 'doc-cloud-card-banner-attributes';
3131
let attributes = {};
3232

33-
// Get cached ad data from session
34-
if (window.sessionStorage.getItem(cacheKey)) {
33+
// Get cached ad data from local storage
34+
if (window.localStorage.getItem(cacheKey)) {
3535
try {
36-
attributes = JSON.parse(window.sessionStorage.getItem(cacheKey));
36+
attributes = JSON.parse(window.localStorage.getItem(cacheKey));
3737
} catch (e) {
3838
console.log('Failed to parse cached ad attributes', e);
3939
}
@@ -54,7 +54,7 @@ export default function DocItemTOCDesktop() {
5454

5555
if (data && typeof data === 'object' && data.hasOwnProperty('attributes')) {
5656
attributes = data.attributes;
57-
window.sessionStorage.setItem(cacheKey, JSON.stringify(attributes));
57+
window.localStorage.setItem(cacheKey, JSON.stringify(attributes));
5858
}
5959
} catch (e) {
6060
console.log('Failed to fetch ad content', e);
@@ -84,7 +84,7 @@ export default function DocItemTOCDesktop() {
8484
maxHeadingLevel={frontMatter.toc_max_heading_level}
8585
className={clsx(styles.docTOC, ThemeClassNames.docs.docTocDesktop)}
8686
/>
87-
<div style={{'marginTop': '32px'}}>
87+
<div>
8888
<Feedback side ={toc.length >= 7 ? 'left' : 'bottom'}/>
8989
</div>
9090

@@ -98,7 +98,7 @@ export default function DocItemTOCDesktop() {
9898
onClick={() => {
9999
setClosed(true);
100100
galaxyOnClick('docs.sidebarCloudAdvert.advertDismissed');
101-
window.sessionStorage.setItem('doc-cloud-card-banner', 'closed');
101+
window.localStorage.setItem('doc-cloud-card-banner', 'closed');
102102
}}>
103103
<IconClose color="var(--ifm-color-emphasis-600)" width={10} height={10}/>
104104
</button>

src/theme/DocItem/TOC/Desktop/styles.module.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,21 @@
3232
}
3333

3434
.docCloudCardHeader h6 {
35-
margin-bottom: 16px;
3635
font-weight: 600;
37-
font-size: 16px;
36+
font-size: 13px;
3837
}
3938

4039
.docCloudCardContent {
4140
font-weight: 400;
42-
font-size: 14px;
43-
margin-bottom: 24px;
41+
font-size: 12px;
4442
}
4543

4644

4745
.docCloudCardLink {
4846
width: fit-content;
49-
padding: 0 16px;
47+
padding: 0 12px;
5048
white-space: nowrap;
49+
font-size: 12px;
5150
}
5251
.docCloudCardLink:hover {
5352
text-decoration: none;
@@ -74,5 +73,6 @@
7473
padding: 1rem;
7574
border-radius: 8px;
7675
margin-bottom: 24px;
76+
height: 200px;
7777
}
7878
}

0 commit comments

Comments
 (0)