A quick introduction

API and how to test it with postman

felipe f. rocha

introduction

so what about apis?

Monitoramento de sistemas

  1. Ações:
    • Processos
      • Transformação
      • Qualidade
    • Ferramentas
      • Automatizadas
  2. Descrevem:
    • Estado interno
      • Performace
      • Saúde
      • etc
 

Introdução

Automação

  1. Continuídade
    • Simplicidade
  2. Qualidade
    • Acurácia¹
    • Repetibilidade
  3. Envolve
    • Pessoas
    • Processos
    • Plataformas / ferramentas

Escalabilidade, Agilidade e consistência

Devops

Ciclo DevOps

  • no SDLC
    • CI
    • CD
    • Cont. Testing
    • Cont. Monitoring

Era DevOps

sli => slo

  1. TEEP
    • Tempo disponível
  2. OOE
    • Tempo de operação regular
  3. OEE
    • Tempo de funcionamento

Paralelo Com Engenharia

Fundamentos

Necessários

Responsabilidade por módulo

 

Pilares de observabilidade

aws cw api

  1. Nome
  2. Dimensão
  3. Tempo
  4. Valor
  5. NameSpace

 

PutMetricData

const metricData - await cloudWatch.putMetricData({
  MetricData: [
    {
      MetricName: 'Teste De App',
      Dimensions: [
        {
          Name: 'Localização',
          Value: 'Brasil' 
        }
      ],
      Timestamp: new Date,
      Value: 123.45
    }
  ],
  Namespace: NOME_METRICA_GRUPO
}).promise();

aws cw api

GetMetricData 

AWS Cloudwatch

na prática...

ferramenta

  • CPU
  • Network
  • Disk
  • Status Check
  1. Intervalo = 5 min / 1 min
  2. Customizável (RAM)

Default metrics

ferramenta

  • CPU
  • Network
  • Disk
  • Status Check
  1. Intervalo = 5 min / 1 min
  2. Customizável (RAM)
  3. Linux Custom tools

EC2

ferramenta

  • IOPS
  • Espaço

 

  1. BurstBalance - Capacidade uso

  2. Total(B) de I/O em um periodo

    1. VolumeReadBytes

    2. VolumeWriteBytes

  3. Total(op) de I/O em um periodo

    1. VolumeReadOps

    2. VolumeWriteOps

  4. VolumeQueueLength

EBS ¹

  • Metricas
    • vide link
  • Eventos ²
    • creação
    • deleção
    • montagem
    • Snapshots eventos

 

ferramenta

  • Metricas
  • Logs de acesso
  • Rastreamento de requisições
  • CloudTrail

 

  1. Historiador (data point - serie temporal)
  2. Logs de acesso - historico instancias del
  3. Apenas para ALB - X-Amzn-Trace-Id
  4. Eventos de api aws

ELB

Script

  • IAM Role = EC2 - FullAccess
  • EC2 - IAM - user data
  • CW metrics
  • Run bash
0
 Advanced issue found

hands on

#!/bin/bash
sudo yum update -y
sudo yum install -y perl-Switch perl-DateTime perl-Sys-Syslog perl-LWP-Protocol-https perl-Digest-SHA.x86_64
cd /home/ec2-user/
curl https://aws-cloudwatch.s3.amazonaws.com/downloads/CloudWatchMonitoringScripts-1.2.2.zip -O
unzip CloudWatchMonitoringScripts-1.2.2.zip && \
rm CloudWatchMonitoringScripts-1.2.2.zip && \
cd aws-scripts-mon
./mon-put-instance-data.pl --mem-util --verify --verbose

# ... No actual 

./mon-put-instance-data.pl --mem-used-incl-cache-buff --mem-util --mem-used --mem-avail

# Optional
./mon-put-instance-data.pl --mem-util --mem-used --mem-avail --auto-scaling=only
./mon-put-instance-data.pl --mem-util --mem-used --mem-avail --aggregated=only

# cron - initialize
*/5 * * * * ~/aws-scripts-mon/mon-put-instance-data.pl --mem-used-incl-cache-buff --mem-util --disk-space-util --disk-path=/ --from-cron

Felipe F. Rocha

felipe.rocha@dtidigital.com

 

 

OBRIGADO!!!

API & How to Test with Postman

By Felipe Fonseca Rocha

API & How to Test with Postman

This is a quick introduction on Rest #API and how to test them with #Postman considering only the main and most common concepts. The focus here is to introduce the topic and give you some hints on best practices when testing APIs so you are able to start you design correctly and have a meaningful set of tests that help you keep track of changes in your backend application.

  • 75