Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{
"extension": [
".ts"
],
"include": [
"src/**"
],
"extension": [".ts"],
"include": ["src/**"],
"reporter": ["text", "json"],
"exclude": [
"**/*.d.ts",
Expand Down
4 changes: 1 addition & 3 deletions examples/react-load/preact/.babelrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"env": {
"test": {
"presets": [
["preact-cli/babel", { "modules": "commonjs" }]
]
"presets": [["preact-cli/babel", { "modules": "commonjs" }]]
}
}
}
6 changes: 3 additions & 3 deletions examples/react-load/preact/public/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset=utf-8 />
<meta charset="utf-8" />
<title>React Load Example: Preact</title>
</head>
<body>
<div id="root"></div>
<div id="root"></div>
</body>
</html>
6 changes: 3 additions & 3 deletions examples/react-load/react/public/index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset=utf-8 />
<meta charset="utf-8" />
<title>React Load Example</title>
<script type="text/jsx"></script>
</head>
<body>
<div id="root"></div>
<div id="root"></div>
</body>
</html>
56 changes: 25 additions & 31 deletions examples/react-load/react/src/Content.jsx
Original file line number Diff line number Diff line change
@@ -1,61 +1,55 @@
import React from 'react';
import { Button} from 'reactstrap';
import { BaseOpenTelemetryComponent } from '@opentelemetry/plugin-react-load'
import { Button } from 'reactstrap';
import { BaseOpenTelemetryComponent } from '@opentelemetry/plugin-react-load';

class Content extends BaseOpenTelemetryComponent {
constructor(props){
super(props)
constructor(props) {
super(props);
this.state = {
results: null,
isLoading: false
}
isLoading: false,
};
}

componentDidMount(){
componentDidMount() {
// Example, do something here
}

buttonHandler() {
this.setState({isLoading: true})
const randomDelay = Math.random() * 10000;
this.setState({ isLoading: true });
const randomDelay = Math.random() * 10000;
setTimeout(() => {
this.setState({
isLoading: false,
results: randomDelay
})
},
randomDelay);
results: randomDelay,
});
}, randomDelay);
}

renderResults(){
if(this.state.isLoading){
renderResults() {
if (this.state.isLoading) {
return <div> Loading results...</div>;
}
if (!this.state.results){
return (
<div>No Results</div>
)
}
return (
<div>
Request was delayed {this.state.results} ms
</div>
)
if (!this.state.results) {
return <div>No Results</div>;
}
return <div>Request was delayed {this.state.results} ms</div>;
}

render() {
return (
<div>
<h1>React Plugin Demo App</h1>
<Button onClick={() => this.buttonHandler()} style={{marginBottom: '20px'}}>
<Button
onClick={() => this.buttonHandler()}
style={{ marginBottom: '20px' }}
>
Make Request
</Button>
<div id="results">
{this.renderResults()}
</div>
<div id="results">{this.renderResults()}</div>
</div>
)
);
}
}

export default Content;
10 changes: 5 additions & 5 deletions examples/react-load/react/src/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ class Home extends BaseOpenTelemetryComponent {
render() {
return (
<div>
<h1>
React Plugin Demo App
</h1>
<Link to='/test'><button>Enter</button></Link>
<h1>React Plugin Demo App</h1>
<Link to="/test">
<button>Enter</button>
</Link>
</div>
)
);
}
}

Expand Down
19 changes: 10 additions & 9 deletions examples/react-load/react/src/index.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import React from 'react';
import ReactDOM from 'react-dom';
import {BrowserRouter as Router, Route } from 'react-router-dom';
import { BrowserRouter as Router, Route } from 'react-router-dom';
import Home from './Home';
import Content from './Content';
import Tracer from './web-tracer.js';

Tracer('example-react-load')
Tracer('example-react-load');

ReactDOM.render(
<Router>
<main>
<Route exact path='/' component={Home}/>
<Route exact path='/test' component={Content}/>
</main>
</Router>
,document.getElementById('root'));
<Router>
<main>
<Route exact path="/" component={Home} />
<Route exact path="/test" component={Content} />
</main>
</Router>,
document.getElementById('root')
);
34 changes: 16 additions & 18 deletions examples/web/examples/document-load/index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Document Load Plugin Example</title>
<base href="/" />

<head>
<meta charset="utf-8">
<title>Document Load Plugin Example</title>
<base href="/">

<!--
<!--
https://www.w3.org/TR/trace-context/
Set the `traceparent` in the server's HTML template code. It should be
dynamically generated server side to have the server's request trace Id,
Expand All @@ -15,17 +14,16 @@
(01 = sampled, 00 = notsampled).
'{version}-{traceId}-{spanId}-{sampleDecision}'
-->
<!-- <meta name="traceparent" content="00-ab42124a3c573678d4d8b21ba52df3bf-d21f7bc17caa5aba-01">-->

<meta name="viewport" content="width=device-width, initial-scale=1">
</head>

<body>
Example of using Web Tracer with document load plugin with console exporter and collector exporter
<script type="text/javascript" src="document-load.js"></script>
<br/>
<button id="button1">Test WebTracer with ZoneContextManager - async</button>
<!-- <meta name="traceparent" content="00-ab42124a3c573678d4d8b21ba52df3bf-d21f7bc17caa5aba-01">-->

</body>
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>

<body>
Example of using Web Tracer with document load plugin with console exporter
and collector exporter
<script type="text/javascript" src="document-load.js"></script>
<br />
<button id="button1">Test WebTracer with ZoneContextManager - async</button>
</body>
</html>
50 changes: 24 additions & 26 deletions examples/web/examples/meta/index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>User Interaction Example</title>
<base href="/" />

<head>
<meta charset="utf-8">
<title>User Interaction Example</title>
<base href="/">

<!--
<!--
https://www.w3.org/TR/trace-context/
Set the `traceparent` in the server's HTML template code. It should be
dynamically generated server side to have the server's request trace Id,
Expand All @@ -15,25 +14,24 @@
(01 = sampled, 00 = notsampled).
'{version}-{traceId}-{spanId}-{sampleDecision}'
-->
<!-- <meta name="traceparent" content="00-ab42124a3c573678d4d8b21ba52df3bf-d21f7bc17caa5aba-01">-->

<meta name="viewport" content="width=device-width, initial-scale=1">
</head>

<body>
Example of using Web Tracer with meta package and with console exporter and collector exporter
<script type="text/javascript" src="meta.js"></script>
<br/>
<button id="btnAdd" class="btnAddClass">Add button</button>
<div>
<div></div>
<div></div>
<div></div>
<div id="buttons"></div>
<div></div>
</div>
<br/>
<!-- <meta name="traceparent" content="00-ab42124a3c573678d4d8b21ba52df3bf-d21f7bc17caa5aba-01">-->

</body>
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>

<body>
Example of using Web Tracer with meta package and with console exporter and
collector exporter
<script type="text/javascript" src="meta.js"></script>
<br />
<button id="btnAdd" class="btnAddClass">Add button</button>
<div>
<div></div>
<div></div>
<div></div>
<div id="buttons"></div>
<div></div>
</div>
<br />
</body>
</html>
50 changes: 24 additions & 26 deletions examples/web/examples/user-interaction/index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>User Interaction Example</title>
<base href="/" />

<head>
<meta charset="utf-8">
<title>User Interaction Example</title>
<base href="/">

<!--
<!--
https://www.w3.org/TR/trace-context/
Set the `traceparent` in the server's HTML template code. It should be
dynamically generated server side to have the server's request trace Id,
Expand All @@ -15,25 +14,24 @@
(01 = sampled, 00 = notsampled).
'{version}-{traceId}-{spanId}-{sampleDecision}'
-->
<!-- <meta name="traceparent" content="00-ab42124a3c573678d4d8b21ba52df3bf-d21f7bc17caa5aba-01">-->

<meta name="viewport" content="width=device-width, initial-scale=1">
</head>

<body>
Example of using Web Tracer with UserInteractionInstrumentation and XMLHttpRequestInstrumentation with console exporter and collector exporter
<script type="text/javascript" src="user-interaction.js"></script>
<br/>
<button id="btnAdd" class="btnAddClass">Add button</button>
<div>
<div></div>
<div></div>
<div></div>
<div id="buttons"></div>
<div></div>
</div>
<br/>
<!-- <meta name="traceparent" content="00-ab42124a3c573678d4d8b21ba52df3bf-d21f7bc17caa5aba-01">-->

</body>
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>

<body>
Example of using Web Tracer with UserInteractionInstrumentation and
XMLHttpRequestInstrumentation with console exporter and collector exporter
<script type="text/javascript" src="user-interaction.js"></script>
<br />
<button id="btnAdd" class="btnAddClass">Add button</button>
<div>
<div></div>
<div></div>
<div></div>
<div id="buttons"></div>
<div></div>
</div>
<br />
</body>
</html>
4 changes: 2 additions & 2 deletions karma.webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ module.exports = {
// because the `util` package expects there to be a global variable named `process`.
// Thanks to https://stackoverflow.com/a/65018686/14239942
// NOTE: I wish there was a better way as this pollutes the tests with a defined 'process' global.
process: 'process/browser.js'
})
process: 'process/browser.js',
}),
],
module: {
rules: [
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@
"test-services:stop": "docker compose -f ./test/docker-compose.yaml down",
"test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=./test/test-services.env npm test",
"test-all-versions:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=./test/test-services.env npm run test-all-versions",
"lint": "nx run-many -t lint && npm run lint:deps && npm run lint:readme && npm run lint:markdown && npm run lint:semconv-deps",
"lint:fix": "nx run-many -t lint --fix && npm run lint:markdown:fix",
"lint": "nx run-many -t lint && npm run lint:prettier && npm run lint:deps && npm run lint:readme && npm run lint:markdown && npm run lint:semconv-deps",
"lint:fix": "nx run-many -t lint --fix && npm run lint:prettier:fix && npm run lint:markdown:fix",
"lint:deps": "npx --yes [email protected] --dependencies --production --tags=-knipignore",
"lint:markdown": "markdownlint-cli2 $(git ls-files '*.md')",
"lint:markdown:fix": "markdownlint-cli2 --fix $(git ls-files '*.md')",
"lint:prettier": "prettier --check .",
"lint:prettier:fix": "prettier --write .",
"lint:readme": "nx run-many -t lint:readme",
"lint:semconv-deps": "./scripts/lint-semconv-deps.mjs -x packages/contrib-test-utils/src/resource-assertions.ts"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/instrumentation-amqplib/src/amqplib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,8 @@ export class AmqplibInstrumentation extends InstrumentationBase<AmqplibInstrumen
requeue === true
? ' with requeue'
: requeue === false
? ' without requeue'
: ''
? ' without requeue'
: ''
}`
: operation,
});
Expand Down
Loading
Loading