Skip to content

Commit

Permalink
Updating challenges and example ecommerce app code.
Browse files Browse the repository at this point in the history
  • Loading branch information
algogrit committed Apr 23, 2024
1 parent ba50211 commit 7a28f15
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
12 changes: 8 additions & 4 deletions challenges.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
# Challenges

- Instrumenting using APM: https://learn.datadoghq.com/courses/take/intro-to-apm/texts/35843479-lab-instrumenting-an-app-for-datadog-apm
- Monitoring Performance: https://learn.datadoghq.com/courses/take/intro-to-apm/texts/35844827-lab-monitoring-app-performance-with-apm
- Configure Log collection for a containerized application: https://learn.datadoghq.com/courses/take/log-config-docker/texts/54199132-lab-configure-logging-and-log-collection-for-a-containerized-app

- Better Tagging: https://learn.datadoghq.com/courses/take/tagging-best-practices/texts/35811424-lab-tagging-an-application-service
- Build & manage a log pipeline: https://learn.datadoghq.com/courses/take/log-pipelines/texts/51586134-lab-build-and-manage-a-log-pipeline

- Configure Log collection for a containerized application: https://learn.datadoghq.com/courses/take/log-config-docker/texts/54199132-lab-configure-logging-and-log-collection-for-a-containerized-app
- Instrumenting using APM: https://learn.datadoghq.com/courses/take/intro-to-apm/texts/35843479-lab-instrumenting-an-app-for-datadog-apm
- Monitoring Performance: https://learn.datadoghq.com/courses/take/intro-to-apm/texts/35844827-lab-monitoring-app-performance-with-apm

- Tracing & Spans: https://learn.datadoghq.com/courses/take/create-custom-spans-and-tags/texts/50365658-lab-creating-spans-and-span-tags

- Database Monitoring: https://learn.datadoghq.com/courses/take/database-monitoring/texts/43408007-database-monitoring-lab

- Dashboard Setup: https://learn.datadoghq.com/courses/take/dashboards-slos/texts/48964609-creating-an-executive-dashboard

## Optional

- Better Tagging: https://learn.datadoghq.com/courses/take/tagging-best-practices/texts/35811424-lab-tagging-an-application-service
7 changes: 5 additions & 2 deletions rvstore/orders/cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import (
"os"
"strings"

"github.com/gorilla/handlers"
log "github.com/sirupsen/logrus"

"agarwalconsulting.io/rvstore/orders/pkg/endpoints"
"agarwalconsulting.io/rvstore/orders/pkg/repository"
"agarwalconsulting.io/rvstore/orders/pkg/service"
"agarwalconsulting.io/rvstore/orders/pkg/transport"
"github.com/gorilla/handlers"
log "github.com/sirupsen/logrus"
)

var (
Expand All @@ -20,6 +21,8 @@ var (
)

func init() {
log.SetFormatter(&log.JSONFormatter{})

var ok bool
mongoURL, ok = os.LookupEnv("MONGO_DB_URL")
if !ok {
Expand Down
10 changes: 9 additions & 1 deletion rvstore/products/cmd/server/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,16 @@ var appdashAddr = fs.String("appdash-addr", "", "Enable Appdash tracing via an A
func Run() {
fs.Parse(os.Args[1:])

f, err := os.OpenFile("./logs/products.log", os.O_RDWR|os.O_APPEND|os.O_CREATE, 0644)

if err != nil {
fmt.Println("Unable to open log file:", err)
return
}
defer f.Close()

// Create a single logger, which we'll use and give to other components.
logger = log.NewLogfmtLogger(os.Stderr)
logger = log.NewLogfmtLogger(f)
logger = log.With(logger, "ts", log.DefaultTimestampUTC)
logger = log.With(logger, "caller", log.DefaultCaller)

Expand Down

0 comments on commit 7a28f15

Please sign in to comment.