Skip to content

Commit 5bd4b9b

Browse files
committed
[chore] Refresh refcache, fix external links with invalid fragments
1 parent 78deeae commit 5bd4b9b

File tree

17 files changed

+566
-506
lines changed

17 files changed

+566
-506
lines changed

content/en/blog/2023/jmx-metric-insight/index.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,9 @@ that our Kafka installation is working as expected.
111111
### Export metrics to Prometheus
112112

113113
The metrics can be exported by any of the supported metric exporters, to a
114-
backend of your choice. The full list of exporters and their configuration
115-
options can be found
116-
[here](https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md#exporters).
117-
For instance, you can export the metrics to an OTel collector using the OTLP
114+
backend of your choice. For the full list of exporters and their configuration
115+
options, see [Configure the SDK](/docs/languages/java/configuration/). For
116+
instance, you can export the metrics to an OTel collector using the OTLP
118117
exporter, perform some processing and then consume the metrics on a backend of
119118
your choice. In this example for the sake of simplicity, we are directly
120119
exporting the metrics to Prometheus.

content/en/blog/2024/collector-roadmap/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ wanted to focus on:
6565
OTLP exporter.
6666
2. Individual Go modules that the Collector components rely upon must also be
6767
marked as stable as per the project's
68-
[versioning guidelines](https://github.com/open-telemetry/opentelemetry-collector/blob/main/VERSIONING.md#public-api-expectations).
68+
[versioning guidelines](https://github.com/open-telemetry/opentelemetry-collector/blob/main/VERSIONING.md#general-go-api-considerations).
6969

7070
Aside from this, there were a few areas the contributors wanted to improve based
7171
on user feedback:

content/en/blog/2024/go-contrib-removal.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ To become a code owner of one of the modules, you need to be a member of the
4747
OpenTelemetry organization and have a good working knowledge of the code you
4848
seek to maintain. To become a member of OpenTelemetry in GitHub, see the
4949
requirements in
50-
[Community membership](https://github.com/open-telemetry/community/blob/main/community-membership.md#requirements).
50+
[Community membership](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#requirements).
5151

5252
If you satisfy all requirements,
5353
[open an issue](https://github.com/open-telemetry/opentelemetry-go-contrib/issues/new?assignees=&labels=&projects=&template=owner.md&title=).

content/en/blog/2024/java-metric-systems-compared/index.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -285,13 +285,13 @@ The result is a configurable option unique to OpenTelemetry Java called
285285
what their memory mode is based on whether they read metric state concurrently
286286
or not. Right now you opt into the optimized memory behavior (which we call
287287
`MemoryMode.reusable_data`) via an
288-
[environment variable](https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure#exporters).
289-
In the future, the optimized memory mode will be enabled by default, since only
290-
exceptional cases need concurrent access to the metric state. It turns out that
291-
the objects holding the metric state (`MetricData` in OpenTelemetry Java terms)
292-
account for virtually all of the memory allocation in the collect cycle. By
293-
reusing these (along with other internal objects used to hold state), **we
294-
reduced the memory allocation of the core metric SDK by over 99%**. See
288+
[environment variable](/docs/languages/java/configuration/). In the future, the
289+
optimized memory mode will be enabled by default, since only exceptional cases
290+
need concurrent access to the metric state. It turns out that the objects
291+
holding the metric state (`MetricData` in OpenTelemetry Java terms) account for
292+
virtually all of the memory allocation in the collect cycle. By reusing these
293+
(along with other internal objects used to hold state), **we reduced the memory
294+
allocation of the core metric SDK by over 99%**. See
295295
[this blog post](https://medium.com/@asafmesika/optimizing-java-observability-opentelemetrys-new-memory-mode-reduces-memory-allocations-by-99-98-e0062eccdc3f)
296296
for more details.
297297

content/en/docs/demo/docker-deployment.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ cSpell:ignore: otlphttp spanmetrics tracetest tracetesting
1010
## Prerequisites
1111

1212
- Docker
13-
- [Docker Compose](https://docs.docker.com/compose/install/#install-compose)
14-
v2.0.0+
13+
- [Docker Compose](https://docs.docker.com/compose/install/) v2.0.0+
1514
- Make (optional)
1615
- 6 GB of RAM for the application
1716

content/en/docs/kubernetes/operator/troubleshooting/target-allocator.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ See the full `OpenTelemetryCollector`
329329
### Did you configure a ServiceMonitor (or PodMonitor) selector?
330330

331331
If you configured a
332-
[`ServiceMonitor`](https://observability.thomasriley.co.uk/prometheus/configuring-prometheus/using-service-monitors/#:~:text=The%20ServiceMonitor%20is%20used%20to,build%20the%20required%20Prometheus%20configuration.)
332+
[`ServiceMonitor`](https://observability.thomasriley.co.uk/prometheus/configuring-prometheus/using-service-monitors/)
333333
selector, it means that the Target Allocator only looks for `ServiceMonitors`
334334
having a `metadata.label` that matches the value in
335335
[`serviceMonitorSelector`](https://github.com/open-telemetry/opentelemetry-operator/blob/main/docs/api.md#opentelemetrycollectorspectargetallocatorprometheuscr-1).

content/en/docs/languages/java/getting-started.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,10 @@ value=8192, exemplars=[]}], monotonic=false, aggregationTemporality=CUMULATIVE}}
245245

246246
For more:
247247

248-
- Run this example with another [exporter][] for telemetry data.
248+
- Run this example with another [exporter] for telemetry data.
249249
- Try [zero-code instrumentation](/docs/zero-code/java/agent/) on one of your
250250
own apps.
251-
- For light-weight customized telemetry, try [annotations][].
251+
- For light-weight customized telemetry, try [annotations].
252252
- Learn about [manual instrumentation][] and try out more
253253
[examples](../examples/).
254254
- Take a look at the [OpenTelemetry Demo](/docs/demo/), which includes Java
@@ -260,10 +260,8 @@ For more:
260260
[logs]: /docs/concepts/signals/logs/
261261
[annotations]: /docs/zero-code/java/agent/annotations/
262262
[configure the java agent]: /docs/zero-code/java/agent/configuration/
263-
[console exporter]:
264-
https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md#logging-exporter
265-
[exporter]:
266-
https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md#exporters
263+
[console exporter]: /docs/languages/java/configuration/
264+
[exporter]: /docs/languages/java/configuration/
267265
[java-vers]:
268266
https://github.com/open-telemetry/opentelemetry-java/blob/main/VERSIONING.md#language-version-compatibility
269267
[manual instrumentation]: ../instrumentation

content/en/docs/languages/php/_index.md

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ cSpell:ignore: mbstring opcache
1212
## Further Reading
1313

1414
- [OpenTelemetry for PHP on GitHub](https://github.com/open-telemetry/opentelemetry-php)
15-
- [Installation](https://github.com/open-telemetry/opentelemetry-php#installation)
1615
- [Examples](https://github.com/open-telemetry/opentelemetry-php/tree/main/examples)
1716

1817
## Requirements

content/en/docs/languages/ruby/getting-started.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ a few more features that will allow you gain even deeper insights!
189189

190190
[traces]: /docs/concepts/signals/traces/
191191
[instrumentations]:
192-
https://github.com/open-telemetry/opentelemetry-ruby#instrumentation-libraries
192+
https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation
193193
[config]: ../libraries/#configuring-specific-instrumentation-libraries
194194
[exporters]: ../exporters/
195195
[context propagation]: ../instrumentation/#context-propagation

content/en/docs/zero-code/java/spring-boot-starter/getting-started.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ project. For example, if you import the `spring-boot-dependencies` BOM, you have
3636
to declare it after the OpenTelemetry BOMs.
3737

3838
Gradle selects the
39-
[latest version](https://docs.gradle.org/current/userguide/dependency_resolution.html#sec:version-conflict)
39+
[latest version](https://docs.gradle.org/current/userguide/dependency_resolution.html#2_perform_conflict_resolution)
4040
of a dependency when multiple BOMs, so the order of BOMs is not important.
4141

4242
{{% /alert %}}
@@ -106,7 +106,7 @@ with the `io.spring.dependency-management` plugin.
106106
Add the dependency given below to enable the OpenTelemetry starter.
107107

108108
The OpenTelemetry starter uses OpenTelemetry Spring Boot
109-
[autoconfiguration](https://docs.spring.io/spring-boot/docs/current/reference/html/using.html#using.auto-configuration).
109+
[autoconfiguration](https://docs.spring.io/spring-boot/reference/using/auto-configuration.html).
110110

111111
{{< tabpane text=true >}} {{% tab header="Maven (`pom.xml`)" lang=Maven %}}
112112

content/en/docs/zero-code/net/troubleshooting.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ that require the assemblies used to instrument .NET Framework applications, the
157157
ones under the `netfx` folder of the installation directory, to be also
158158
installed into the Global Assembly Cache (GAC):
159159

160-
1. [**Monkey patch instrumentation**](https://en.wikipedia.org/wiki/Monkey_patch#:~:text=Monkey%20patching%20is%20a%20technique,Python%2C%20Groovy%2C%20etc.)
160+
1. [**Monkey patch instrumentation**](https://en.wikipedia.org/wiki/Monkey_patch)
161161
of assemblies loaded as domain-neutral.
162162
2. Assembly redirection for strong-named applications if the app also ships
163163
different versions of some assemblies also shipped in the `netfx` folder.

data/ecosystem/vendors.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206
commercial: true
207207
- name: Logz.io
208208
nativeOTLP: false
209-
url: https://docs.logz.io/shipping/tracing-sources/opentelemetry.html#overview
209+
url: https://docs.logz.io/docs/shipping/other/opentelemetry-data/
210210
contact:
211211
oss: false
212212
commercial: true
@@ -338,7 +338,7 @@
338338
commercial: true
339339
- name: SolarWinds
340340
nativeOTLP: true
341-
url: https://documentation.solarwinds.com/en/success_center/observability/default.htm#cshid=third-otel-integration
341+
url: https://documentation.solarwinds.com/en/success_center/observability/content/intro/otel.htm
342342
contact:
343343
oss: false
344344
commercial: true

data/registry/application-integration-python-cisco-nso.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ authors:
1616
url: https://www.cisco.com/
1717
urls:
1818
website: https://www.cisco.com/c/en/us/products/cloud-systems-management/network-services-orchestrator/index.html
19-
docs: https://developer.cisco.com/docs/nso/#!observability-exporter/
19+
docs: https://developer.cisco.com/docs/nso/observability-exporter/
2020
createdAt: '2024-08-06'
2121
isFirstParty: true

scripts/content-modules/adjust-pages.pl

+1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ ()
118118
s|(docs/specs/otel/logs/api.md#emit-a)n-event|$1-logrecord|;
119119
s|\[semantic-convention-groups\]|[group-stability]|;
120120
s|\Q../../docs/|../|g; # https://github.com/open-telemetry/semantic-conventions/pull/1843
121+
s|\Qhttps://wikipedia.org/wiki/Where_(SQL)#IN|https://wikipedia.org/wiki/SQL_syntax#Operators|g;
121122
}
122123

123124
sub getVersFromSubmodule() {

scripts/double-check-refcache-400s.mjs

+68-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22

33
import fs from 'fs/promises';
44
import { getUrlStatus, isHttp2XX } from './get-url-status.mjs';
5+
import { exit } from 'process';
56

67
const CACHE_FILE = 'static/refcache.json';
8+
const GOOGLE_DOCS_URL = 'https://docs.google.com/';
9+
let maxFragEntries = 3;
710
const cratesIoURL = 'https://crates.io/crates/';
811

912
async function readRefcache() {
@@ -23,20 +26,59 @@ async function writeRefcache(cache) {
2326

2427
// Retry HTTP status check for refcache URLs with non-200s and not 404
2528
async function retry400sAndUpdateCache() {
29+
console.log(`Checking ${CACHE_FILE} for 4XX status URLs ...`);
2630
const cache = await readRefcache();
2731
let updated = false;
32+
let entriesCount = 0;
33+
let urlWithFragmentCount = 0;
2834

2935
for (const [url, details] of Object.entries(cache)) {
36+
entriesCount++;
37+
const parsedUrl = new URL(url);
3038
const { StatusCode, LastSeen } = details;
39+
3140
if (isHttp2XX(StatusCode)) continue;
32-
if (StatusCode === 404 && !url.startsWith(cratesIoURL)) {
33-
console.log(`Skipping 404: ${url} (last seen ${LastSeen}).`);
41+
if (isHttp2XX(StatusCode) && (!parsedUrl.hash || StatusCode >= 210))
42+
continue;
43+
44+
if (
45+
(StatusCode === 404 && !url.startsWith(cratesIoURL)) ||
46+
StatusCode === 422
47+
) {
48+
const lastSeenDate = new Date(LastSeen).toLocaleString();
49+
console.log(
50+
`Skipping ${StatusCode}: ${url} (last seen ${lastSeenDate}).`,
51+
);
3452
continue;
3553
}
54+
if (url.startsWith(GOOGLE_DOCS_URL)) {
55+
// console.log(`Skipping Google Docs URL (for now): ${url}.`);
56+
continue;
57+
/*
58+
URLs are of the form:
59+
https://docs.google.com/document/d/15vR7D1x2tKd7u3zaTF0yH1WaHkUr2T4hhr7OyiZgmBg/edit?tab=t.0#heading=h.4xuru5ljcups
60+
We can simply check for the presence of the heading query parameter value in the page.
61+
"ps_hdid":"h.4xuru5ljcups" # cSpell:disable-line
62+
*/
63+
}
64+
65+
if (
66+
parsedUrl.hash &&
67+
StatusCode < 210 &&
68+
++urlWithFragmentCount > maxFragEntries
69+
)
70+
break;
71+
72+
process.stdout.write(
73+
`Checking${
74+
parsedUrl.hash ? ` for fragment in` : `:`
75+
} ${url} (was ${StatusCode}) ... `,
76+
);
3677

37-
process.stdout.write(`Checking: ${url} (was ${StatusCode}) ... `);
3878
const verbose = false;
39-
const status = await getUrlStatus(url, verbose);
79+
let status = await getUrlStatus(url, verbose);
80+
if (parsedUrl.hash && isHttp2XX(status)) status += 10;
81+
4082
console.log(`${status}.`);
4183

4284
if (!isHttp2XX(status)) continue;
@@ -56,4 +98,26 @@ async function retry400sAndUpdateCache() {
5698
}
5799
}
58100

101+
function getNumericFlagValue(flagName) {
102+
const flagArg = process.argv.find((arg) => arg.startsWith(flagName));
103+
if (!flagArg) return;
104+
105+
const valueArg = flagArg.includes('=')
106+
? flagArg.split('=')[1]
107+
: process.argv[process.argv.indexOf(flagName) + 1];
108+
let value = parseInt(valueArg);
109+
110+
if (!value) {
111+
console.error(
112+
`ERROR: invalid value for ${flagName}: ${valueArg}. ` +
113+
`Must be a number > 0. Using default ${maxFragEntries}.`,
114+
);
115+
exit(1);
116+
}
117+
return value;
118+
}
119+
120+
const _maxFragEntriesFlag = getNumericFlagValue('--max-frag-entries');
121+
if (_maxFragEntriesFlag) maxFragEntries = _maxFragEntriesFlag;
122+
59123
await retry400sAndUpdateCache();

scripts/get-url-status.mjs

+69-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
#!/usr/bin/env node
22

33
import puppeteer from 'puppeteer'; // Consider using puppeteer-core
4+
import { URL } from 'url';
5+
6+
const DOCS_ORACLE_URL = 'https://docs.oracle.com/';
7+
const STATUS_OK_BUT_FRAG_NOT_FOUND = 422;
48

59
const cratesIoURL = 'https://crates.io/crates/';
610
let verbose = false;
711

8-
function log(...args) {
12+
export function log(...args) {
913
if (!verbose) return;
1014
const lastArg = args[args.length - 1];
1115
if (typeof lastArg === 'string' && lastArg.endsWith(' ')) {
@@ -15,11 +19,67 @@ function log(...args) {
1519
}
1620
}
1721

22+
// Check for fragment and corresponding anchor ID in page.
23+
async function checkForFragment(url, page, status) {
24+
const parsedUrl = new URL(url);
25+
if (parsedUrl.hash) {
26+
let fragmentID = parsedUrl.hash.substring(1); // Remove the leading '#'
27+
// if (url.startsWith(DOCS_ORACLE_URL)) { // Would also need for GitHub.com
28+
fragmentID = decodeURIComponent(fragmentID);
29+
// }
30+
31+
let anchorExists =
32+
//
33+
// Look for ID attribute in the page.
34+
//
35+
(await page.evaluate((id) => {
36+
return !!document.getElementById(id);
37+
}, fragmentID)) ||
38+
//
39+
// Look for named anchors
40+
//
41+
(await page.evaluate((name) => {
42+
const elt = document.querySelector(`a[name="${name}"]`);
43+
return !!elt;
44+
}, fragmentID)) ||
45+
//
46+
// Github.com repo special cases
47+
//
48+
(url.startsWith('https://github.com/') &&
49+
(await anchorExistsInGitHub(page, fragmentID)));
50+
51+
if (!anchorExists) status = STATUS_OK_BUT_FRAG_NOT_FOUND;
52+
}
53+
return status;
54+
}
55+
56+
async function anchorExistsInGitHub(page, fragmentID) {
57+
if (/L\d+(-L\d+)?/.test(fragmentID)) {
58+
// Handle line references in GitHub repos.
59+
return await page.evaluate((name) => {
60+
// Look for references to the fragment in the page, possibly with an
61+
// `-ov-file` suffix (used as anchors of tabs in repo landing pages).
62+
return !!document.querySelector('div.highlighted-line');
63+
}, fragmentID);
64+
}
65+
66+
// Handle other fragment references in GitHub repos, link references
67+
// to files (such as README), or to headings inside of displayed markdown.
68+
return await page.evaluate((name) => {
69+
// Look for references to the fragment in the page, possibly with an
70+
// `-ov-file` suffix (used as anchors of tabs in repo landing pages).
71+
const elt = document.querySelector(
72+
`a[href="#${name}"], a[href="#${name}-ov-file"]`,
73+
);
74+
return !!elt;
75+
}, fragmentID);
76+
}
77+
1878
async function getUrlHeadless(url) {
1979
// Get the URL, headless, while trying our best to avoid triggering
2080
// bot-rejection from some servers. Returns the HTTP status code.
2181

22-
log(`Headless fetch of ${url} ... `);
82+
log(`Fetch ${url} headless ... `);
2383

2484
let browser;
2585
try {
@@ -62,6 +122,7 @@ async function getUrlHeadless(url) {
62122
if (!crateNameRegex.test(title)) status = 404;
63123
}
64124

125+
status = await checkForFragment(url, page, status);
65126
log(`${status}; page title: '${title}'`);
66127

67128
return status;
@@ -87,8 +148,10 @@ async function getUrlInBrowser(url) {
87148

88149
if (!response) throw new Error('No response from server.');
89150

90-
const status = response.status();
91-
log(`HTTP status code: ${status}`);
151+
let status = response.status();
152+
const title = await page.title();
153+
status = await checkForFragment(url, page, status);
154+
log(`${status}; page title: '${title}'`);
92155

93156
return status;
94157
} catch (error) {
@@ -107,7 +170,8 @@ export async function getUrlStatus(url, _verbose = false) {
107170
verbose = _verbose;
108171
let status = await getUrlHeadless(url);
109172
// If headless fetch fails, try in browser for non-404 statuses
110-
if (!isHttp2XX(status) && status !== 404) {
173+
if (!isHttp2XX(status) && status !== 404 && status !== 422) {
174+
log(`\n\t retrying in browser ... `);
111175
status = await getUrlInBrowser(url);
112176
}
113177
return status;

0 commit comments

Comments
 (0)