Skip to content

Commit cf27a99

Browse files
authored
Merge pull request #271 from commercetools/opentelemetry-integration
DEVX-477 some fixes and new APM integration with open telemetry
2 parents 65512f0 + 21216b2 commit cf27a99

40 files changed

+2042
-8
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ The SDK consists of the following projects:
6767
* `lib/commercetools-history/src`: Contains all generated models and request builders to communicate with the [Change History API](https://docs.commercetools.com/api/history/change-history).
6868

6969
In addition, the SDK has the following directories:
70-
* `examples/symfony-app` : it shows how the PHP SDK can be used in a Symfony application for a Docker environment with NewRelic monitoring enabled.
70+
* `examples/` : One Dockerized Symfony app per APM (New Relic, Datadog, Dynatrace, OpenTelemetry) to demo PHP SDK usage.
7171
* `test/integration` : Integration Tests for the SDK. A good way for anyone using the PHP SDK to understand it further.
7272
* `test/unit` : Unit Tests for
7373
* `lib/commercetools-api-tests` : generated unit test for each class for the api folder
@@ -957,7 +957,17 @@ To migrate from the 1.x to the 2.x, there is a guideline below:
957957

958958
## Observability
959959

960-
To monitor and observe the SDK, see the official documentation [Observability](https://docs.commercetools.com/sdk/observability), there is a [Demo application](https://github.com/commercetools/commercetools-sdk-php-v2/tree/master/examples/symfony-app) which shows how to monitor the PHP SDK with New Relic and Datadog.
960+
To monitor and observe the SDK, see the official documentation [Observability](https://docs.commercetools.com/sdk/observability), there is a [Demo application](https://github.com/commercetools/commercetools-sdk-php-v2/tree/master/examples/) which shows how to monitor the PHP SDK with New Relic, Datadog, Dynatrace and Open Telemetry.
961+
962+
To monitor and observe the SDK, refer to the official documentation on [Observability](https://docs.commercetools.com/sdk/observability).
963+
964+
The [Demo application](https://github.com/commercetools/commercetools-sdk-php-v2/tree/master/examples/) demonstrates how to monitor the PHP SDK with the following APMs:
965+
966+
- [New Relic](https://github.com/commercetools/commercetools-sdk-php-v2/tree/master/examples/symfony-app-newrelic)
967+
- [Datadog](https://github.com/commercetools/commercetools-sdk-php-v2/tree/master/examples/symfony-app-datadog)
968+
- [Dynatrace](https://github.com/commercetools/commercetools-sdk-php-v2/tree/master/examples/symfony-app-dynatrace)
969+
- [OpenTelemetry](https://github.com/commercetools/commercetools-sdk-php-v2/tree/master/examples/symfony-app-opentelemetry) (configured to work with New Relic for distributed tracing)
970+
Each APM integration is implemented through configuration and can be easily enabled using the provided instructions in the demo app for each platform.
961971

962972
## Documentation
963973

examples/symfony-app-datadog/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ services:
3535
image: datadog/agent:latest
3636
environment:
3737
- DD_API_KEY=${DD_API_KEY}
38-
- DD_SITE=datadoghq.com
38+
- DD_SITE=${DD_SITE}
3939
- DD_APM_ENABLED=true
4040
ports:
4141
- "127.0.0.1:8126:8126/tcp"

examples/symfony-app-datadog/docker/php/.env.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ DD_API_KEY=your datadog api key
2626
DD_APM_ENABLED=true
2727
DD_TRACE_CLI_ENABLED=true
2828
DD_TRACE_ENABLED=true
29-
DD_SITE=datadoghq.com
29+
DD_SITE=datadoghq.XXX your datadog site
3030

3131
# APP_NAME=PHP-SDK
3232
###< symfony/framework-bundle ###

examples/symfony-app-datadog/src/Controller/IndexController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
77
use Symfony\Component\HttpFoundation\Response;
88

9-
//added just because New Relic<->Symfony needed it
109
class IndexController extends AbstractController
1110
{
1211
private $logger;

examples/symfony-app-dynatrace/docker/php/Dockerfile.dynatrace

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# Specify the appropriate platform for x86_64
21
FROM php:8.2-fpm
32

43
# Install necessary packages and PHP extensions

examples/symfony-app-dynatrace/src/Controller/IndexController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
77
use Symfony\Component\HttpFoundation\Response;
88

9-
//added just because New Relic<->Symfony needed it
109
class IndexController extends AbstractController
1110
{
1211
private $logger;

examples/symfony-app-newrelic/src/Controller/IndexController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
77
use Symfony\Component\HttpFoundation\Response;
88

9-
//added just because New Relic<->Symfony needed it
109
class IndexController extends AbstractController
1110
{
1211
private $logger;
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
**/*.log
2+
**/*.md
3+
**/*.php~
4+
**/*.dist.php
5+
**/*.dist
6+
**/*.cache
7+
**/._*
8+
**/.dockerignore
9+
**/.DS_Store
10+
**/.git/
11+
**/.gitattributes
12+
**/.gitignore
13+
**/.gitmodules
14+
**/docker-compose.*.yaml
15+
**/docker-compose.*.yml
16+
**/docker-compose.yaml
17+
**/docker-compose.yml
18+
**/Dockerfile
19+
**/Thumbs.db
20+
.github/
21+
docs/
22+
public/bundles/
23+
tests/
24+
var/
25+
vendor/
26+
.editorconfig
27+
.env.*.local
28+
docker/php/.env.sample
29+
.env.local.php
30+
.env.test
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
# Change these settings to your own preference
9+
indent_style = space
10+
indent_size = 4
11+
12+
# We recommend you to keep these unchanged
13+
end_of_line = lf
14+
charset = utf-8
15+
trim_trailing_whitespace = true
16+
insert_final_newline = true
17+
18+
[*.{js,html,ts,tsx}]
19+
indent_style = space
20+
indent_size = 2
21+
22+
[*.json]
23+
indent_style = space
24+
indent_size = 2
25+
26+
[*.md]
27+
trim_trailing_whitespace = false
28+
29+
[*.php]
30+
indent_style = space
31+
indent_size = 4
32+
33+
[*.sh]
34+
indent_style = tab
35+
indent_size = 4
36+
37+
[*.xml{,.dist}]
38+
indent_style = space
39+
indent_size = 4
40+
41+
[*.{yaml,yml}]
42+
indent_style = space
43+
indent_size = 4
44+
trim_trailing_whitespace = false
45+
46+
[.github/workflows/*.yml]
47+
indent_style = space
48+
indent_size = 2
49+
50+
[.gitmodules]
51+
indent_style = tab
52+
indent_size = 4
53+
54+
[.php_cs{,.dist}]
55+
indent_style = space
56+
indent_size = 4
57+
58+
[.travis.yml]
59+
indent_style = space
60+
indent_size = 2
61+
62+
[composer.json]
63+
indent_style = space
64+
indent_size = 4
65+
66+
[docker-compose{,.*}.{yaml,yml}]
67+
indent_style = space
68+
indent_size = 2
69+
70+
[Dockerfile]
71+
indent_style = tab
72+
indent_size = 4
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
* text=auto eol=lf
2+
3+
*.conf text eol=lf
4+
*.html text eol=lf
5+
*.ini text eol=lf
6+
*.js text eol=lf
7+
*.json text eol=lf
8+
*.md text eol=lf
9+
*.php text eol=lf
10+
*.sh text eol=lf
11+
*.yaml text eol=lf
12+
*.yml text eol=lf
13+
bin/console text eol=lf
14+
15+
*.ico binary
16+
*.png binary

0 commit comments

Comments
 (0)