top of page
  • Writer's pictureShaked Braimok Yosef

How to Build a Developer Portal Using Grafana

In modern organizations, the ability to provide comprehensive visibility into development processes, track projects, and facilitate collaboration between teams is critical. These portals give developers and managers an overall view of all activities, allow for data cross-referencing from different sources, and streamline workflows. There are many external portals available that come with built-in features, providing accurate visibility and advanced resource management.

This article is excellent for both Grafana users and those who aren’t but want to provide a developer portal while still saving costs. This solution is significantly cheaper than external portals, which is why this article suggests not using Managed Grafana on AWS but rather installing Grafana on ECS Fargate. Of course, if you are not a Grafana user and have connected to the Backstage interface, you can choose it as well.

Installing Grafana on ECS Fargate Using Terraform

To set up Grafana on AWS ECS Fargate using Terraform, follow these steps:


  1. Define the ECS Cluster:

Use Terraform to define a new cluster in ECS Fargate, you can do this using the following Terraform resources in your configuration file:

resource "aws_ecs_cluster" "grafana_cluster" {
  name = "grafana-cluster"
}

2. Define the Task Definition:

Define the Grafana task definition using Terraform:

resource "aws_ecs_task_definition" "grafana_task" {
  family                   = "grafana-task"
  requires_compatibilities = ["FARGATE"]
  network_mode             = "awsvpc"
  cpu                      = "256"
  memory                   = "512"
  execution_role_arn       = aws_iam_role.ecs_task_execution_role.arn
  task_role_arn            = aws_iam_role.ecs_task_execution_role.arn

  container_definitions = jsonencode([{
    name      = "grafana"
    image     = "grafana/grafana:latest"
    essential = true
    portMappings = [{
      containerPort = 3000
      hostPort      = 3000
    }]
  }])
}

3. Deploy the Service:

Finally, define an ECS service to run the task definition on Fargate:

resource "aws_ecs_service" "grafana_service" {
  name            = "grafana-service"
  cluster         = aws_ecs_cluster.grafana_cluster.id
  task_definition = aws_ecs_task_definition.grafana_task.arn
  desired_count   = 1
  launch_type     = "FARGATE"
  network_configuration {
    subnets          = aws_subnet.public.*.id
    security_groups  = [aws_security_group.grafana_sg.id]
    assign_public_ip = true
  }
}

Anyone who wants to create the service manually in the AWS Console can refer to the relevant AWS documentation: ECS Fargate Documentation.



Creating a Developer Portal Using Grafana

Once Grafana is installed, you can start setting up your Developer Portal:


Integrations:

  • Connect to data sources like Jira, GitHub, Jenkins, Prometheus, and more.

  • Ensure all important information is consolidated in one platform, allowing you to track all stages of development from one place.


Developer Involvement:

  • Create dashboards for each development team to track tasks, bugs, and performance.

  • Use Grafana plugins to add additional capabilities like alerts on critical issues and displaying the progress of Pull Requests.

  • 💡 My recommendation is to grant as many permissions as possible so developers can import data as they wish, experiment, and improve their dashboards themselves — after all, developers are the users, and they know best what they need.


What the Dashboard Should Contain:

  • Track build times, deployments, code quality, and system performance.

  • Dashboards can include both general metrics for the organization and specific metrics for each team or project.


Creating Dashboards for Each Team:

  • Tailor the dashboards so that each team can see the data relevant to them.

  • Display graphs, tables, and indicators that provide quick and effective information for each user.

Conclusion

This article not only explains how to create a Developer Portal using Grafana but also conveys the message that building such a portal depends on your creativity and inspiration. The market is full of open-source tools that can be used to create customized solutions. Choosing the right tool and the right approach will help you achieve your goals most effectively.

What other tools would you leverage for creative uses? Write to me! ✍️

Comments


bottom of page