Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for logging via DataDog #88

Merged
merged 2 commits into from
Dec 19, 2023

Conversation

chimedpalden
Copy link
Contributor

@chimedpalden chimedpalden commented Dec 15, 2023

Description

This PR Adds the Datadog logger. I'll be removing all other logger once the Datadog integration is tested successfully on preview and on production.

#87

Screenshot 2023-12-18 at 12 14 54 PM

@chimedpalden chimedpalden self-assigned this Dec 15, 2023
@chimedpalden chimedpalden added the enhancement New feature or request label Dec 15, 2023

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@bbbneo333 bbbneo333 linked an issue Dec 15, 2023 that may be closed by this pull request

This comment has been minimized.

This comment has been minimized.

Copy link
Member

@bbbneo333 bbbneo333 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix typos.

Also, from ticket, is this requirement being fulfilled?

A log should have clear details on environment (staging, production, etc..)

If yes - Can post example of a screenshot where it has the environment?


import WinstonLogger from './winston-logger';

export default class DatedogLogger extends WinstonLogger {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo - DatedogLogger

@@ -2,6 +2,7 @@ import ConfigService from '../../config/config-service';
import { UnknownTransportError } from '../types';

import ConsoleLogger from './console-logger';
import DatedogLogger from './datadog-logger';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo - DatedogLogger

This comment has been minimized.

This comment has been minimized.

1 similar comment

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link

Passed

Analysis Details

0 Issues

  • Bug0 Bugs
  • Vulnerability0 Vulnerabilities
  • Code Smell0 Code Smells

Coverage and Duplications

  • No coverage informationNo coverage information (0.00% Estimated after merge)
  • 3 percent duplication0.00% Duplicated Code (0.00% Estimated after merge)

Project ID: jalantechnologies_boilerplate-mern

View in SonarQube

Copy link

Deployment (boilerplate-mern) is available at - https://912c72aad493c7a.preview.platform.jalantechnologies.com

Copy link

Code Coverage

Package Line Rate Branch Rate Health
backend 96% 50%
backend.modules.access-token 100% 100%
backend.modules.access-token.internal 100% 100%
backend.modules.access-token.rest-api 98% 100%
backend.modules.account 77% 100%
backend.modules.account.internal 94% 67%
backend.modules.account.internal.store 92% 50%
backend.modules.account.rest-api 100% 100%
backend.modules.communication 83% 75%
backend.modules.communication.internals 90% 56%
backend.modules.config 92% 88%
backend.modules.error 81% 50%
backend.modules.logger 78% 100%
backend.modules.logger.internals 65% 42%
backend.modules.task 90% 100%
backend.modules.task.internal 95% 60%
backend.modules.task.internal.store 92% 50%
backend.modules.task.rest-api 94% 100%
Summary 88% (553 / 632) 66% (60 / 91)

Minimum allowed line rate is 60%

@chimedpalden
Copy link
Contributor Author

Please fix typos.

Also, from ticket, is this requirement being fulfilled?

A log should have clear details on environment (staging, production, etc..)

If yes - Can post example of a screenshot where it has the environment?

@bbbneo333 fixed the typo. The environment can be determined by the service name for eg: boilerplate-mern-preview or boilerplate-mern-production.

Screenshot 2023-12-18 at 4 17 59 PM

@@ -15,4 +15,5 @@ export enum LoggerTransport {
Rollbar = 'rollbar',
Grafana = 'grafana',
Papertrail = 'papertrail',
Datadog = 'datadog',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove support for all other logger types such as Rollbar, Grafana, Papertrail etc to reflect one opiniated approach on monitoring / logging from boilerplate standpoint or would that be part of separate PR?

Copy link
Contributor Author

@chimedpalden chimedpalden Dec 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, @jjalan i'll remove it in a separate PR. I just wanted to test the end-to-end flow from logging to alert in the MS team via datadog in preview env before removing other options.

@bbbneo333
Copy link
Member

LGTM!
@chimedpalden - Please make sure appropriate env vars are already set in doppler before merging the PR.

@bbbneo333 bbbneo333 changed the title feat: add datadog logger feat: Add support for logging via DataDog Dec 18, 2023
@chimedpalden chimedpalden merged commit 5f76b5b into main Dec 19, 2023
6 checks passed
@chimedpalden chimedpalden deleted the chimed/feat/integrate-datadog branch December 19, 2023 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for logging via DataDog
3 participants